Skip to content

Commit

Permalink
Merge pull request netblue30#4574 from a1346054/shellcheck-fix
Browse files Browse the repository at this point in the history
Fix shellcheck warnings
  • Loading branch information
kmk3 authored Nov 5, 2021
2 parents d681e0e + efcd54c commit a75645f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions gcov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License GPL v2

gcov_init() {
USER=`whoami`
USER="$(whoami)"
firejail --help > /dev/null
firemon --help > /dev/null
/usr/lib/firejail/fnet --help > /dev/null
Expand All @@ -20,15 +20,15 @@ gcov_init() {
/usr/lib/firejail/faudit --help > /dev/null
/usr/lib/firejail/fbuilder --help > /dev/null

sudo chown $USER:$USER `find .`
find . -exec sudo chown "$USER:$USER" '{}' +
}

generate() {
lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-new
lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file
rm -fr gcov-dir
genhtml -q gcov-file --output-directory gcov-dir
sudo rm `find . -name *.gcda`
find . -name '*.gcda' -exec sudo rm '{}' +
cp gcov-file gcov-file-old
gcov_init
}
Expand Down
4 changes: 2 additions & 2 deletions linecnt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License GPL v2

gcov_init() {
USER=`whoami`
USER="$(whoami)"
firejail --help > /dev/null
firemon --help > /dev/null
/usr/lib/firejail/fnet --help > /dev/null
Expand All @@ -20,7 +20,7 @@ gcov_init() {
/usr/lib/firejail/faudit --help > /dev/null
/usr/lib/firejail/fbuilder --help > /dev/null

sudo chown $USER:$USER `find .`
find . -exec sudo chown "$USER:$USER" '{}' +
}

rm -fr gcov-dir
Expand Down
12 changes: 6 additions & 6 deletions mkasc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

echo "Calculating SHA256 for all files in /transfer - firejail version $1"

cd /transfer
sha256sum * > firejail-$1-unsigned
gpg --clearsign --digest-algo SHA256 < firejail-$1-unsigned > firejail-$1.asc
gpg --verify firejail-$1.asc
gpg --detach-sign --armor firejail-$1.tar.xz
rm firejail-$1-unsigned
cd /transfer || exit 1
sha256sum ./* > "firejail-$1-unsigned"
gpg --clearsign --digest-algo SHA256 < "firejail-$1-unsigned" > "firejail-$1.asc"
gpg --verify "firejail-$1.asc"
gpg --detach-sign --armor "firejail-$1.tar.xz"
rm "firejail-$1-unsigned"
38 changes: 19 additions & 19 deletions mkdeb.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -35,36 +35,36 @@ 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
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"
10 changes: 5 additions & 5 deletions mkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

set -e

sed "s/VERSION/$1/g" $2 > $3
MONTH=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b`
sed -i "s/MONTH/$MONTH/g" $3
YEAR=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y`
sed -i "s/YEAR/$YEAR/g" $3
sed "s/VERSION/$1/g" "$2" > "$3"
MONTH="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b)"
sed -i "s/MONTH/$MONTH/g" "$3"
YEAR="$(LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y)"
sed -i "s/YEAR/$YEAR/g" "$3"
4 changes: 2 additions & 2 deletions mkuid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ echo "#define FIREJAIL_UIDS_H" >> uids.h

if [ -r /etc/login.defs ]
then
UID_MIN=`awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
GID_MIN=`awk '/^\s*GID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
UID_MIN="$(awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs)"
GID_MIN="$(awk '/^\s*GID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs)"
fi

# use default values if not found
Expand Down

0 comments on commit a75645f

Please sign in to comment.