99set -ex
1010
1111export DEBIAN_FRONTEND=noninteractive
12- export DEB_BUILD_OPTIONS=" parallel=$( egrep -c ' ^processor' /proc/cpuinfo) "
12+ DEB_BUILD_OPTIONS=" parallel=$( grep -E -c ' ^processor' /proc/cpuinfo) "
13+ export DEB_BUILD_OPTIONS
1314
1415if $IS_NIGHTLY ; then
1516 PKGBASE=" hhvm-nightly"
@@ -34,23 +35,23 @@ apt-get clean
3435apt-get install -y devscripts equivs
3536
3637# Source extraction
37- cp /var/out/${PKGBASE} -$VERSION .tar.gz ${PKGBASE} _$VERSION .orig.tar.gz
38- tar zxf ${PKGBASE} _$VERSION .orig.tar.gz
39- cd ${PKGBASE} -$VERSION
40- cp -R $DISTRO_ROOT /debian/ debian/
38+ cp " /var/out/${PKGBASE} -$VERSION .tar.gz" " ${PKGBASE} _$VERSION .orig.tar.gz"
39+ tar zxf " ${PKGBASE} _$VERSION .orig.tar.gz"
40+ cd " ${PKGBASE} -$VERSION "
41+ cp -R " $DISTRO_ROOT /debian/" debian/
4142cp -R /opt/hhvm-packaging/skeleton/ debian/skeleton
4243
4344if ! $IS_NIGHTLY ; then
4445 sed -i ' /^Conflicts: hhvm$/d' debian/control
4546 sed -i ' s/hhvm-nightly/hhvm/' debian/control
4647 sed -i ' s/hhvm-nightly/hhvm/' debian/rules
4748 for file in debian/hhvm-nightly* ; do
48- mv " $file " " $( echo $file | sed ' s/ hhvm-nightly/hhvm/ ' ) "
49+ mv " $file " " ${ $file // hhvm-nightly/ hhvm} "
4950 done
5051fi
5152
5253# Add debian changelog entry
53- dch --create -v $VERSION -$PKGVER --package ${PKGBASE} --controlmaint --distribution " $DISTRIBUTION " --force-distribution --empty
54+ dch --create -v " $VERSION -$PKGVER " --package ${PKGBASE} --controlmaint --distribution " $DISTRIBUTION " --force-distribution --empty
5455
5556# Build debian package that depends on build-depends, and install it
5657mk-build-deps
@@ -61,15 +62,18 @@ mv "$BUILD_DEPS_NEW" "$OUT" || rm "$BUILD_DEPS_OLD"
6162# Build the actual debian packages
6263PREBUILD=" $DISTRO_ROOT /make-package.prebuild"
6364if [ -x " $PREBUILD " ]; then
65+ # shellcheck disable=SC1090
6466 source $PREBUILD
6567fi
6668debuild -us -uc
6769cd ..
68- FILES=$( awk ' /^Files:/ { files=1; next } /^[^ ]/ { files=0; next } files==1 { print $NF }' * .changes)
70+ FILES=$( awk ' /^Files:/ { files=1; next } /^[^ ]/ { files=0; next } files==1 { print $NF }' ./ * .changes)
6971if [ -z " $FILES " ]; then
7072 echo " Failed to identify neccessary files"
7173 exit 1
7274fi
73- cp * .changes $FILES " $OUT "
75+ # FILES is one-per-line, but SC2086 wants to disable that expansion
76+ # shellcheck disable=SC2086
77+ cp ./* .changes $FILES " $OUT "
7478set +ex
7579echo " Build tree: $TEMP "
0 commit comments