Replying to myself,

well, the fix to support more than external sysno also seems pretty
minimal:


 2009-04-22 11:37:04 --> Task #137939 started.
 2009-04-22 11:37:04 --> Input file '/tmp/scratch.ddd', input mode 
'replace_or_insert'.
 2009-04-22 11:37:05 --> Record 81708 DONE
 2009-04-22 11:37:05 --> Record 81709 DONE
 2009-04-22 11:37:05 --> Task stats: 2 input records, 2 updated, 0 inserted, 0 
errors.  Time 1.57 sec.
 2009-04-22 11:37:05 --> Task #137939 finished.


You may consider it if you think that it may be useful to more
installations.

Thanks,

Ferran
---
 lib/python/invenio/bibupload.py |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

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 10:18:20.000000000 +0200
@@ -826,20 +826,20 @@
                                          CFG_BIBUPLOAD_EXTERNAL_SYSNO_TAG[4:5] or "",
                                          CFG_BIBUPLOAD_EXTERNAL_SYSNO_TAG[5:6])
         if sysnos:
-            sysno = sysnos[0] # there should be only one external SYSNO
-            write_message("   -Checking if SYSNO " + sysno + \
-                          " exists in the database", verbose=9)
-            # try to find the corresponding rec id from the database
-            rec_id = find_record_from_sysno(sysno)
-            if rec_id is not None:
-                # rec_id found
-                pass
-            else:
-                # The record doesn't exist yet. We will try to check
-                # OAI id later.                
-                write_message("   -Tag SYSNO value not found in database.",
-                              verbose=9)
-                rec_id = None
+            for sysno in sysnos: # we may have more than one external SYSNO
+                write_message("   -Checking if SYSNO " + sysno + \
+                              " exists in the database", verbose=9)
+                # try to find the corresponding rec id from the database
+                rec_id = find_record_from_sysno(sysno)
+                if rec_id is not None:
+                    # rec_id found
+                    break
+                else:
+                    # The record doesn't exist yet. We will try to check
+                    # OAI id later.
+                    write_message("   -Tag SYSNO value not found in database.",
+                                  verbose=9)
+                    rec_id = None
         else:
             write_message("   -Tag SYSNO not found in the xml marc file.", verbose=9)
 

Reply via email to