Skip to content

Commit

Permalink
scripts: fix quoting issues found by shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Nov 26, 2024
1 parent 8390faf commit b37d9d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/generate_netboot_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ! [ -f "${CHROOT}/etc/grml_version" ] ; then
exit 1
fi

GRML_VERSION="$(awk '{print $1"_"$2}' ${CHROOT}/etc/grml_version)"
GRML_VERSION=$(awk '{print $1"_"$2}' "${CHROOT}/etc/grml_version")

if ! [ -r "${CHROOT}/usr/lib/syslinux/pxelinux.0" ] ; then
echo "Error: /usr/lib/syslinux/pxelinux.0 not found. Please install syslinux[-common]." >&2
Expand All @@ -43,7 +43,7 @@ cat > "${WORKING_DIR}/pxelinux.cfg/default" << EOF
default grml
label grml
kernel vmlinuz
append initrd=initrd.img root=/dev/nfs rw nfsroot=192.168.0.1:/live/image boot=live apm=power-off quiet nomce noprompt noeject vga=791 net.ifnames=0
append initrd=initrd.img root=/dev/nfs rw nfsroot=192.168.0.1:/live/image boot=live apm=power-off quiet nomce noprompt noeject vga=791 net.ifnames=0
EOF

if tar -C "$OUTPUTDIR" -acf "${OUTPUT_FILE}" "grml_netboot_package_${GRML_VERSION}" ; then
Expand Down
13 changes: 7 additions & 6 deletions scripts/release_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
printf "Building debian/changelog: "
if [ -n "${AUTOBUILD:-}" ] ; then
# since=$(git show -s --pretty="tformat:%h")
eval $(grep '^GRML_LIVE_VERSION=' grml-live)
eval "$(grep '^GRML_LIVE_VERSION=' grml-live)"
DATE=$(date -R)
UNIXTIME=$(date +%s)

Expand All @@ -51,7 +51,7 @@ EOF
git commit -m "Releasing ${GRML_LIVE_VERSION}-~autobuild${UNIXTIME} (auto build)"
else
since=v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')
git-dch --ignore-branch --since=$since \
git-dch --ignore-branch --since="$since" \
--id-length=7 --meta --multimaint-merge -S
printf "OK\n"
fi
Expand Down Expand Up @@ -83,7 +83,7 @@ if [[ "$script_version" == "$debian_version" ]] ; then
printf "OK\n"
else
printf "FAILED\n."
printf "Debian package version ($debian_version) does not match script version ($script_version).\n"
echo "Debian package version ($debian_version) does not match script version ($script_version)."
exit 1
fi

Expand All @@ -98,8 +98,8 @@ if [ -n "${AUTOBUILD:-}" ] ; then
rm -rf ../grml-live.build-area/grml-live* # otherwise we're keeping files forever...
git-buildpackage --git-ignore-branch --git-ignore-new --git-export-dir=../grml-live.build-area -us -uc
else
git-buildpackage --git-ignore-branch --git-ignore-new $*
printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
git-buildpackage --git-ignore-branch --git-ignore-new "$*"
echo "Finished execution of $(basename "$0"). Do not forget to tag release ${debian_version}"
fi

if [ -n "${AUTOBUILD:-}" ] ; then
Expand All @@ -109,11 +109,12 @@ if [ -n "${AUTOBUILD:-}" ] ; then
dpkg-scanpackages . /dev/null | gzip > Packages.gz
)
git checkout master
git branch -D ${autobuild_branch} || true
git branch -D "${autobuild_branch}" || true

env APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none sudo apt-get update

PACKAGES=$(dpkg --list grml-live\* | awk '/^ii/ {print $2}')
# shellcheck disable=SC2086 # PACKAGES needs word-splitting.
env APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none sudo apt-get -y \
-o DPkg::Options::=--force-confmiss \
-o DPkg::Options::=--force-confnew \
Expand Down

0 comments on commit b37d9d4

Please sign in to comment.