diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2018-06-02 00:20:48 +0800 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2018-06-02 00:20:48 +0800 |
commit | ccbfedd88c3cd56ee639bbd29074768d62655b5b (patch) | |
tree | 0fd84994c4c138af4ef746a7acd76eeff8922d5f /Mk | |
parent | 2364943f9d8e1a8fe0fc3f2dbd5c53e5dccdbf10 (diff) | |
download | freebsd-ports-gnome-ccbfedd88c3cd56ee639bbd29074768d62655b5b.tar.gz freebsd-ports-gnome-ccbfedd88c3cd56ee639bbd29074768d62655b5b.tar.zst freebsd-ports-gnome-ccbfedd88c3cd56ee639bbd29074768d62655b5b.zip |
SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
cd can fail for a variety of reasons: misspelled paths, missing
directories, missing permissions, broken symlinks and more.
If/when it does, the script will keep going and do all its operations in
the wrong directory. This can be messy, especially if the operations
involve creating or deleting a lot of files.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Scripts/qa.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index b36dce8e5d3a..dbc2afc24dd3 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -920,7 +920,7 @@ checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" checks="$checks proxydeps sonames perlcore no_arch gemdeps gemfiledeps flavors" ret=0 -cd ${STAGEDIR} +cd ${STAGEDIR} || exit 1 for check in ${checks}; do ${check} || ret=1 done |