From efcd54c0db501e9438cfc97f3ff2e6aa546ecb55 Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 31 Aug 2021 13:24:56 +0000 Subject: Fix some shellcheck warnings Note: This does not modify the configure script, which is a source of a lot of the remaining shellcheck warnings, because it comes from autoconf and so it makes little sense to try to fix it here. Also, it does not modify the scripts in contrib, because they possibly are maintained at some other place. Similarly with the other scripts that don't appear to be called from any of the makefiles. --- mkdeb.sh.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'mkdeb.sh.in') diff --git a/mkdeb.sh.in b/mkdeb.sh.in index e45acf8eb..ddd6ca1ee 100755 --- a/mkdeb.sh.in +++ b/mkdeb.sh.in @@ -22,7 +22,7 @@ if [ -n "$HAVE_SELINUX" ]; then CONFIG_ARGS="$CONFIG_ARGS --enable-selinux" fi -TOP=`pwd` +TOP="$PWD" CODE_ARCHIVE="$NAME-$VERSION.tar.xz" CODE_DIR="$NAME-$VERSION" INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian" @@ -35,9 +35,9 @@ echo "install directory: $INSTALL_DIR" echo "debian control directory: $DEBIAN_CTRL_DIR" echo "*****************************************" -tar -xJvf $CODE_ARCHIVE -#mkdir -p $INSTALL_DIR -cd $CODE_DIR +tar -xJvf "$CODE_ARCHIVE" +#mkdir -p "$INSTALL_DIR" +cd "$CODE_DIR" ./configure $CONFIG_ARGS make -j2 mkdir debian @@ -45,26 +45,26 @@ DESTDIR=debian make install-strip cd .. echo "*****************************************" -SIZE=`du -s $INSTALL_DIR` +SIZE="$(du -s "$INSTALL_DIR")" echo "install size $SIZE" echo "*****************************************" -mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian -gzip -9 -n $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian -rm $INSTALL_DIR/usr/share/doc/firejail/COPYING -install -m644 $CODE_DIR/platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/. -mkdir -p $DEBIAN_CTRL_DIR -sed "s/FIREJAILVER/$VERSION/g" $CODE_DIR/platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH) > $DEBIAN_CTRL_DIR/control +mv "$INSTALL_DIR/usr/share/doc/firejail/RELNOTES" "$INSTALL_DIR/usr/share/doc/firejail/changelog.Debian" +gzip -9 -n "$INSTALL_DIR/usr/share/doc/firejail/changelog.Debian" +rm "$INSTALL_DIR/usr/share/doc/firejail/COPYING" +install -m644 "$CODE_DIR/platform/debian/copyright" "$INSTALL_DIR/usr/share/doc/firejail/." +mkdir -p "$DEBIAN_CTRL_DIR" +sed "s/FIREJAILVER/$VERSION/g" "$CODE_DIR/platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH)" > "$DEBIAN_CTRL_DIR/control" -mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/ -install -m644 $CODE_DIR/platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail +mkdir -p "$INSTALL_DIR/usr/share/lintian/overrides/" +install -m644 "$CODE_DIR/platform/debian/firejail.lintian-overrides" "$INSTALL_DIR/usr/share/lintian/overrides/firejail" -find $INSTALL_DIR/etc -type f | sed "s,^$INSTALL_DIR,," | LC_ALL=C sort > $DEBIAN_CTRL_DIR/conffiles -chmod 644 $DEBIAN_CTRL_DIR/conffiles -find $INSTALL_DIR -type d | xargs chmod 755 -cd $CODE_DIR +find "$INSTALL_DIR/etc" -type f | sed "s,^$INSTALL_DIR,," | LC_ALL=C sort > "$DEBIAN_CTRL_DIR/conffiles" +chmod 644 "$DEBIAN_CTRL_DIR/conffiles" +find "$INSTALL_DIR" -type d -exec chmod 755 '{}' + +cd "$CODE_DIR" fakeroot dpkg-deb --build debian lintian --no-tag-display-limit debian.deb -mv debian.deb ../firejail_${VERSION}${EXTRA_VERSION}_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb +mv debian.deb "../firejail_${VERSION}${EXTRA_VERSION}_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb" cd .. -rm -fr $CODE_DIR +rm -fr "$CODE_DIR" -- cgit v1.2.3-70-g09d2