svn commit: r471272 - head/Mk/Scripts

Mathieu Arnold mat at FreeBSD.org
Fri Jun 1 16:20:49 UTC 2018


Author: mat
Date: Fri Jun  1 16:20:48 2018
New Revision: 471272
URL: https://svnweb.freebsd.org/changeset/ports/471272

Log:
  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

Modified:
  head/Mk/Scripts/qa.sh   (contents, props changed)

Modified: head/Mk/Scripts/qa.sh
==============================================================================
--- head/Mk/Scripts/qa.sh	Fri Jun  1 16:20:45 2018	(r471271)
+++ head/Mk/Scripts/qa.sh	Fri Jun  1 16:20:48 2018	(r471272)
@@ -920,7 +920,7 @@ checks="$checks suidfiles libtool libperl prefixvar ba
 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


More information about the svn-ports-all mailing list