index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-03-28 18:48:29 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2017-04-20 00:23:25 -0400 |
commit | 223818018df7b8763726e7ce6b1bc0fbaed74f67 (patch) | |
tree | fa245147570756b8f5653f91c8113cdacaa35eea /makechrootpkg.in | |
parent | 36f27d6d0b745f8e05f68961e56b899cf9ef2258 (diff) |
-rw-r--r-- | makechrootpkg.in | 16 |
diff --git a/makechrootpkg.in b/makechrootpkg.in index d922fa0..190865e 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 @@ -260,18 +261,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" @@ -316,8 +318,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") ;; |