Bug 13028

Summary: Remove uninitialized value warning and add partial flag to cmp_sysprefs script
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Command-line UtilitiesAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194
Bug 13028: Followup adding a -partial flag for partial compares
Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194
Bug 13028: Followup adding a -partial flag for partial compares
[PASSED QA] Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194
[PASSED QA] Bug 13028: Followup adding a -partial flag for partial compares

Description Marcel de Rooy 2014-10-06 12:09:42 UTC
If you use the restore option with a partial pref file not containing a version, you will have this error. Also the count of updated prefs will be one too high.

This is corrected by a better test of the hash value in the CheckVersionPref subroutine.
Comment 1 Marcel de Rooy 2014-10-06 12:14:35 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2014-10-08 12:39:28 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2014-10-23 18:41:37 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2014-10-23 18:41:53 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2014-10-23 20:12:50 UTC
Thanks, Chris.
Comment 6 Katrin Fischer 2014-10-23 21:56:30 UTC
Created attachment 32645 [details] [review]
[PASSED QA] Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194

If you use the restore option with a partial pref file not containing a version, you will have this error. Also the count of updated prefs will be one too high.

This is corrected by a better test of the hash value in the CheckVersionPref subroutine.

Test plan:
[1] Create a small pref file and remove the version pref (if present). You
could for instance do a pref backup and remove most lines.
[2] Use the restore option with and without this patch.
    So, something like:
        maintclone/misc/maintenance/cmp_sysprefs.pl -c r -f 9999crucial.pref
[3] Check on the error message and the pref count.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2014-10-23 21:56:44 UTC
Created attachment 32646 [details] [review]
[PASSED QA] Bug 13028: Followup adding a -partial flag for partial compares

If you compare the database with a partial pref file, you may not be
interested in lots of lines saying that a pref is not in the file. You
were already aware of that ;)
If you add the -partial flag, these lines will be skipped.

Test plan:
Do as described above.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described, passes tests and QA script.
Comment 8 Tomás Cohen Arazi 2014-10-30 03:35:45 UTC
Patches pushed to master.

Thanks Marcel!