[Koha-bugs] [Bug 34653] New: Make koha-foreach return the correct status code
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Aug 30 05:47:29 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34653
Bug ID: 34653
Summary: Make koha-foreach return the correct status code
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P5 - low
Component: Command-line Utilities
Assignee: koha-bugs at lists.koha-community.org
Reporter: evan at catalyst.net.nz
QA Contact: testopia at bugs.koha-community.org
CC: robin at catalyst.net.nz
Hi
Related to #33645 (and probably #25634), I notice that koha-foreach always
returns 0 (success) even if the commands it tried to run failed.
I think the correct behavior for this script should be that koha-foreach will
return success if all the commands it tried to run succeeded, but failure if
any of the commands failed.
Test plan:
0) `koha-foreach /bin/true; echo $?`
1) Note that the exit status is 0
2) `koha-foreach /bin/false; echo $?`
3) Note that the exit status is 0 (incorrect)
4) Apply patch
5) `koha-foreach /bin/true; echo $?`
6) Note that the exit status is 0
7) `koha-foreach /bin/false; echo $?`
8) Note that the exit status is 1 (correct)
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
More information about the Koha-bugs
mailing list