Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:41:07 -0400
committerErich Eckner <git@eckner.net>2017-07-14 06:54:28 +0200
commit18e2fc20d4eeaa17d4aa1b9b5e323598d68e5227 (patch)
tree15929511cfea529fe343d18bcbd7e49b9bab5eed /makechrootpkg.in
parentbc06145c261145de6a82e9b4ad70de84bf961c0b (diff)
Make purely stylistic changes to make shellcheck happier.
These are purely stylistic changes that make shellcheck complain less. This does NOT include things like quoting currently unquoted variables.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in16
1 files changed, 9 insertions, 7 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 4b6e129..f0c4065 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -190,8 +190,9 @@ prepare_chroot() {
$repack || rm -rf "$copydir/build"
- local builduser_uid="${SUDO_UID:-$UID}"
- local builduser_gid="$(id -g "$builduser_uid")"
+ local builduser_uid builduser_gid
+ builduser_uid="${SUDO_UID:-$UID}"
+ builduser_gid="$(id -g "$builduser_uid")"
local install="install -o $builduser_uid -g $builduser_gid"
local x
@@ -265,18 +266,19 @@ download_sources() {
local copydir=$1
local makepkg_user=$2
- local builddir="$(mktemp -d)"
+ local builddir
+ builddir="$(mktemp -d)"
chmod 1777 "$builddir"
# Ensure sources are downloaded
if [[ "$(id -u "$makepkg_user")" != 0 ]]; then
sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
- makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o
+ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
+ die "Could not download sources."
else
error "Running makepkg as root is not allowed."
exit 1
fi
- (( $? != 0 )) && die "Could not download sources."
# Clean up garbage from verifysource
rm -rf "$builddir"
@@ -321,8 +323,8 @@ main() {
while getopts 'hcur:I:l:nTD:d:U:' arg; do
case "$arg" in
c) clean_first=true ;;
- D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
- d) bindmounts_rw+=(--bind="$OPTARG") ;;
+ D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
+ d) bindmounts_rw+=("--bind=$OPTARG") ;;
u) update_first=true ;;
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;