aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2018-06-02 00:20:48 +0800
committermat <mat@FreeBSD.org>2018-06-02 00:20:48 +0800
commitbb3076fc3f8f15be7bacd52ce2fbdb673cb48eb3 (patch)
tree0fd84994c4c138af4ef746a7acd76eeff8922d5f /Mk
parenta787074a872d349ed760a5ae08303e0f039bd6f2 (diff)
downloadfreebsd-ports-gnome-bb3076fc3f8f15be7bacd52ce2fbdb673cb48eb3.tar.gz
freebsd-ports-gnome-bb3076fc3f8f15be7bacd52ce2fbdb673cb48eb3.tar.zst
freebsd-ports-gnome-bb3076fc3f8f15be7bacd52ce2fbdb673cb48eb3.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.sh2
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