Hi,

I've found in our test installation (still on 0.92.1; yes, we know...)
that when trying to replace and/or update a bunch of records with
bibupload -ri, bibupload does not check the existence of those records
via CFG_BIBUPLOAD_EXTERNAL_SYSNO_TAG, but only rec_id.  Apparently the
current code still has the same behaviour:

http://cdsware.cern.ch/repo/?p=cds-invenio.git;a=blob;f=modules/bibupload/lib/bibupload.py#l192

First, I thought that this tiny patch should fix it:

Index: invenio/lib/python/invenio/bibupload.py
===================================================================
--- invenio.orig/lib/python/invenio/bibupload.py  2009-04-22 09:39:39.000000000 
+0200
+++ invenio/lib/python/invenio/bibupload.py  2009-04-22 09:45:56.000000000 +0200
@@ -489,7 +489,8 @@
             write_message("   -Check if reference tags exist: DONE", verbose=2)
      
     if options['mode'] == 'insert' or \
-       (options['mode'] == 'replace_or_insert' and rec_id is None):
+       (options['mode'] == 'replace_or_insert' and \
+        (rec_id is None) or (find_record_from_sysno(sysno) is None):
         insert_mode_p = True
         # Insert the record into the bibrec databases to have a recordId
         rec_id = create_new_record()


But in our case, it doesn't.  When inspecting the code, I've found
something that I'd like to comment:

def retrieve_rec_id(record):
[...]
        if sysnos:
            sysno = sysnos[0] # there should be only one external SYSNO
            write_message("   -Checking if SYSNO " + sysno + \
                          " exists in the database", verbose=9)

(http://cdsware.cern.ch/repo/?p=cds-invenio.git;a=blob;f=modules/bibupload/lib/bibupload.py#l617)


Do yo have any strong reason why there should be only a *single*
external sysno?  In our case, trying to consolidate information from
three different origins (our traditional catalog, our regional union
catalog, and different local repositories), having more than one
external sysno is almost an imperative need, because some of those
records (our theses, for example), may have three external ids, that we
differenciate with a different prefix, but may be in any order and may
exist in any order in our Invenio.

I'd like to hear your opinion before trying to provide a patch.

Thanks,

Ferran

Reply via email to