Bug 13028 - Remove uninitialized value warning and add partial flag to cmp_sysprefs script
Summary: Remove uninitialized value warning and add partial flag to cmp_sysprefs script
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-06 12:09 UTC by Marcel de Rooy
Modified: 2015-06-04 23:33 UTC (History)
1 user (show)

See Also:
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 (1.57 KB, patch)
2014-10-06 12:14 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 13028: Followup adding a -partial flag for partial compares (1.94 KB, patch)
2014-10-08 12:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194 (1.57 KB, patch)
2014-10-23 18:41 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 13028: Followup adding a -partial flag for partial compares (1.95 KB, patch)
2014-10-23 18:41 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194 (1.64 KB, patch)
2014-10-23 21:56 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 13028: Followup adding a -partial flag for partial compares (2.07 KB, patch)
2014-10-23 21:56 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!