Bug 37709

Summary: bulkmarcimport.pl should die when the file cannot be opened
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Command-line UtilitiesAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to stable --- QA Contact: Julian Maurice <julian.maurice>
Severity: normal    
Priority: P5 - low CC: julian.maurice, lucas, robin
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37478
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:
Attachments: Bug 37709: Die and notify if file cannot be opened
Bug 37709: Die and notify if file cannot be opened
Bug 37709: Die and notify if file cannot be opened

Description Nick Clemens (kidclamp) 2024-08-22 11:35:31 UTC
To recreate:
1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
2 - Output:
Characteristic MARC flavour: MARC21

0 MARC records done in 0.00804400444030762 seconds
Comment 1 Nick Clemens (kidclamp) 2024-08-22 11:37:26 UTC
Created attachment 170602 [details] [review]
Bug 37709: Die and notify if file cannot be opened

1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
2 - Output:
    Characteristic MARC flavour: MARC21

    0 MARC records done in 0.00804400444030762 seconds
3 - Apply patch
4 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
5 - Output:
    Characteristic MARC flavour: MARC21
    Could not open notafile.mrc: No such file or directory at misc/migration_tools/bulkmarcimport.pl line 262.
Comment 2 Roman Dolny 2024-08-22 12:56:05 UTC
Created attachment 170608 [details] [review]
Bug 37709: Die and notify if file cannot be opened

1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
2 - Output:
    Characteristic MARC flavour: MARC21

    0 MARC records done in 0.00804400444030762 seconds
3 - Apply patch
4 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
5 - Output:
    Characteristic MARC flavour: MARC21
    Could not open notafile.mrc: No such file or directory at misc/migration_tools/bulkmarcimport.pl line 262.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Julian Maurice 2024-10-04 07:50:54 UTC
Created attachment 172378 [details] [review]
Bug 37709: Die and notify if file cannot be opened

1 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
2 - Output:
    Characteristic MARC flavour: MARC21

    0 MARC records done in 0.00804400444030762 seconds
3 - Apply patch
4 - perl misc/migration_tools/bulkmarcimport.pl -b --file=notafile.mrc -v
5 - Output:
    Characteristic MARC flavour: MARC21
    Could not open notafile.mrc: No such file or directory at misc/migration_tools/bulkmarcimport.pl line 262.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Katrin Fischer 2024-10-11 09:15:35 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Lucas Gass (lukeg) 2024-11-18 22:55:45 UTC
Backported to 24.05.x for upcoming 24.05.06