Koha/debian/scripts
Evan Giles d9849aaa3a
Bug 34653: Make koha-foreach return the correct status code
I think the correct behavior for this script should be that koha-foreach
will return 0 (success) if all the commands it tried to run succeeded, but
1 (failure) if any of the commands failed.

To test:
1. $ koha-create --create-db test
2. $ vi test.sh
if [ $USER = 'kohadev-koha' ]; then
    echo "FAILED";
    exit 1;
else
    echo "SUCCESS";
    exit 0;
fi

3. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
4. $ echo $?
5. Note that the exit status is 0 (success)

6. Apply patch

7. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
8. $ echo $?
9. Note that the exit status is 1 (failure)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-25 10:56:40 -03:00
..
koha-create Bug 25622: Use special chars in DB password (koha-create) 2022-07-05 08:41:55 -03:00
koha-create-dirs
koha-disable
koha-dump Bug 21903: (follow-up) koha-dump can export uploaded and temporary uploaded files 2022-07-05 11:46:37 -03:00
koha-dump-defaults
koha-elasticsearch
koha-email-disable
koha-email-enable
koha-enable
koha-es-indexer Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 10:56:40 -03:00
koha-functions.sh Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-indexer Bug 32811: Remove useless lines for indexer.log 2023-03-06 09:51:49 -03:00
koha-list Bug 33108: Teach koha-list filter elasticsearch 2023-03-20 09:39:46 -03:00
koha-mysql Bug 30468: Restore 'set -e' and remove echos 2022-08-01 09:18:50 -03:00
koha-mysqlcheck
koha-passwd Bug 28493: Make koha-passwd display the username 2023-07-19 13:00:41 -03:00
koha-plack Bug 21366: Add --reload option to koha-plack help/manual 2022-08-26 15:52:06 -03:00
koha-rebuild-zebra
koha-remove Bug 33108: Make init handle koha-es-indexer 2023-03-20 09:39:47 -03:00
koha-reset-passwd
koha-restore Bug 10517: (QA follow-up) No need to remove second true 2022-05-03 11:19:50 -10:00
koha-run-backups Bug 21111: Add --exclude-indexes to koha-run-backups 2020-11-04 12:59:34 +01:00
koha-shell Bug 28519: Add lib to koha-shell 2021-06-17 15:59:40 +02:00
koha-sip Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning 2022-08-18 09:00:39 -03:00
koha-sitemap
koha-translate Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker Bug 32992: Move background_jobs_worker to misc/workers 2023-02-24 17:52:19 -03:00
koha-z3950-responder Bug 25716: (QA follow-up) Move additional options to etc/z3950/config.xml 2022-10-24 13:11:27 -03:00
koha-zebra Bug 30684: (follow-up) Use log_warning_msg for the "not running" warning 2022-08-18 09:00:39 -03:00