Bug 7924

Summary: Fix handling of command line arguments in koha-remove
Product: Koha Reporter: Scott Turner <koha-bugzilla>
Component: PackagingAssignee: Magnus Enger <magnus>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: critical    
Priority: P1 - high CC: chris, koha-bugzilla, magnus, paul.poulain, robin
Version: 3.8   
Hardware: PC   
OS: Linux   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 6684    
Attachments: koha-remove change I used as a workaround
Bug 7924 - Fix handling of command line arguments in koha-remove
Bug 7924 - Fix handling of command line arguments in koha-remove

Description Scott Turner 2012-04-09 00:32:24 UTC Comment hidden (obsolete)
Comment 1 Katrin Fischer 2012-04-14 13:31:32 UTC
Adding Robin (package maintainer) in CC.
Comment 2 Robin Sheat 2012-04-15 02:40:06 UTC
That's strange that the set would corrupt that. Off the top of my head, I'm not sure what would be going on there.
Comment 3 Magnus Enger 2012-04-30 11:54:05 UTC Comment hidden (obsolete)
Comment 4 Jared Camins-Esakov 2012-05-08 13:47:41 UTC
Created attachment 9456 [details] [review]
Bug 7924 - Fix handling of command line arguments in koha-remove

koha-remove would fail with a message like this:
Removing Koha instance --
ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_--'@'%'

After fixing this, the --keep-mysql option made the script exit without doing
anything.

To test:

Alt 1
- Build package with build-git-snapshot
- Install package

Alt 2
- Replicate the changes in the patch in an existing installation

Then:
- Add instance1 and instance2
- koha-remove instance1
-- Check that script completes and the databse is gone
- koha-remove --keep-mysql instance2
-- Check that the script completes but the database is not removed

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 5 Jared Camins-Esakov 2012-05-09 16:54:35 UTC
This bug will be included in the Koha 3.6.5 release. Incorporated into stable prior to inclusion in master because the patch is required for the release process.
Comment 6 Chris Cormack 2012-05-09 19:58:34 UTC
Can we get this through qa please it is needed for the 3.8.1 releaae
Comment 7 Ian Walls 2012-05-10 16:15:23 UTC
Only affects packages, and the changes look simple enough:  add an eval, then move the exit line separate from the mysql command.

Marking Passed QA.
Comment 8 Chris Cormack 2012-05-14 20:40:25 UTC
This fix will be in 3.8.1