]> git.ipfire.org Git - thirdparty/shadow.git/commit
Makefile: bail out on error in for-loops 205/head
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Dec 2019 17:54:30 +0000 (18:54 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Dec 2019 17:54:30 +0000 (18:54 +0100)
commit258944e331f542a883c9059849b0f087e5b0152c
tree65107f4e246b57fe7f12854cf2c05826782d504a
parent51d65f37e5a26be96c9bbb729543975b508c6c29
Makefile: bail out on error in for-loops

`make` runs each line in a shell and bails out on error,
however, the shell is not started with `-e`, so commands in
`for` loops can fail without the error actually causing
`make` to bail out with a failure status.

For instance, the following make snippet will end
successfully, printing 'SUCCESS', despite the first `chmod`
failing:

    all:
        touch a b
        for i in a-missing-file a b; do \
            chmod 666 $$i; \
        done
        @echo SUCCESS

To prevent wrong paths in install scripts from remaining
unnoticed, let's activate `set -e` in the `for` loop
subshells.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/Makefile.am