Bug 10159 - koha-rebuild-zebra error handling
authorTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 30 Apr 2013 14:58:25 +0000 (11:58 -0300)
committerBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fri, 14 Jun 2013 02:20:57 +0000 (23:20 -0300)
commita675bc263c6a6d0322483a0b54c06f009e83eae9
tree465f0c873526c05001d89af052f2a74640bb9787
parent00aa61dec0c7e9d6c77158d33c69d0108135211b
Bug 10159 - koha-rebuild-zebra error handling

This patch makes koha-rebuild-zebra:
- Check for the existence of the instance
- Handle arbitrary amount of instance parameters
- Capture -a and -b (which made the script rebuild twice the chosen DB). It adds the extended version (--authorities and --biblios respectively) of the option switch. This makes the -a and -b switches work as "only do authorities" (or viceversa). They can be used concurrently, which is the default behaviour when no switch is provided.
- Handle -v (and --verbose) as koha-rebuild-zebra options, to ease the use for non-techie users.
- The rebuild_zebra.pl is wrapped inside an IF to return error values if we ever make rebuild_zebra.pl return error codes (this is pointed in the code).
- Added -h/--help switches and an 'usage' output :-D Please provide patches for any wording issues, or contact me to fix it.

To test:
- Apply the patch and create your packages (or just use the script from your branch)
- Run it in this scenarios / options
  - -h/--help to see the available option switches
  - Mix them with one or more instances, of which some could be fake
  - try -a/--authorities and -b/--biblios in all possible combinations
  - try -v/--verbose works

Regards
To+

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 39d3b9088a34b464708e40d1fd20a954d4a6e702)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit a3422a47027188b7b76f137fd92effe328ca30c3)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a3422a47027188b7b76f137fd92effe328ca30c3)
debian/docs/koha-rebuild-zebra.xml
debian/scripts/koha-rebuild-zebra