Bug 10735: prevent koha-dump from aborting if backupdir undefined
authorRobin Sheat <robin@catalyst.net.nz>
Tue, 19 Nov 2013 02:26:02 +0000 (15:26 +1300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 15 Jan 2014 17:28:48 +0000 (14:28 -0300)
commit72fdbbd6633a6b7fd2757b429339bcacc2a43f7a
tree0183403c422bfdd6f3c332b674351ed0914acf62
parentd7a7336dff3e33d566b2c85efd689963ef7826de
Bug 10735: prevent koha-dump from aborting if backupdir undefined

Older versions of Koha didn't have <backupdir>...</backupdir> defined in
koha-conf.xml. The koha-dump script is aware of this, and checks to see
if it's there. However, if it's not, xmlstarlet returns a non-0 error
code which causes the script to abort due to running under set -e.

Test plan:
 * Remove backupdir from koha-conf.xml
 * Run koha-dump, notice that it doesn't do backups
 * Apply patch
 * Run koha-dump again, notice that it does do backups

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The fallback method works as described. It might be made more robust
like checking for dir existence (thinking of older instances upgrades).
But it certainly belongs to another bug report.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
As Tomas said, it would be better to alert the user if the backupdir tag
does not exist (or contains a nonexistent directory) in the config file.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 266f2a3a9f3d67fed0e0b35d267419a901345b92)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit de1344c2759631e1a8d505151630f160ebdab768)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
debian/scripts/koha-dump