diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-10-20 01:49:02 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2014-10-21 02:00:46 +0200 |
commit | 273d5a7a4325b830fc0038abdc7fc8a1bb55bfd9 (patch) | |
tree | 62d082e00411c3a3099e9d3b5357fefb3800bf16 | |
parent | e5fe74102dee0dc1b7343666f3b9d41446e7cf86 (diff) | |
download | devtools-273d5a7a4325b830fc0038abdc7fc8a1bb55bfd9.tar.gz devtools-273d5a7a4325b830fc0038abdc7fc8a1bb55bfd9.tar.xz |
makechrootpkg: treat makepkg_args as array
-rw-r--r-- | makechrootpkg.in | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in index c8cb169..26deaca 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -12,7 +12,7 @@ m4_include(lib/common.sh) shopt -s nullglob -makepkg_args='-s --noconfirm -L --holdver' +makepkg_args=(-s --noconfirm -L --holdver) repack=false update_first=false clean_first=false @@ -46,7 +46,7 @@ usage() { echo 'command:' echo ' mkarchroot <chrootdir>/root base-devel' echo '' - echo "Default makepkg args: $makepkg_args" + echo "Default makepkg args: ${makepkg_args[*]}" echo '' echo 'Flags:' echo '-h This help' @@ -77,7 +77,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do r) passeddir="$OPTARG" ;; I) install_pkgs+=("$OPTARG") ;; l) copy="$OPTARG" ;; - n) run_namcap=true; makepkg_args="$makepkg_args -i" ;; + n) run_namcap=true; makepkg_args+=(-i) ;; T) temp_chroot=true; copy+="-$$" ;; h|*) usage ;; esac @@ -102,7 +102,7 @@ else fi # Pass all arguments after -- right to makepkg -makepkg_args="$makepkg_args ${*:$OPTIND}" +makepkg_args+=("${@:$OPTIND}") # See if -R was passed to makepkg for arg in "${@:OPTIND}"; do @@ -265,8 +265,12 @@ EOF # This is a little gross, but this way the script is recreated every time in the # working copy { - printf $'#!/bin/bash\n%s\n_chrootbuild %q %q || exit\n' "$(declare -f _chrootbuild)" \ - "$makepkg_args" "$run_namcap" + printf '#!/bin/bash\n' + declare -f _chrootbuild + printf '_chrootbuild' + printf ' %q' "${makepkg_args[@]}" + printf ' || exit\n' + if $run_namcap; then cat <<'EOF' pacman -S --needed --noconfirm namcap @@ -302,7 +306,6 @@ download_sources() { _chrootbuild() { # This function isn't run in makechrootpkg, # so no global variables - local makepkg_args="$1" . /etc/profile export HOME=/build @@ -338,7 +341,7 @@ _chrootbuild() { exit 1 fi - sudo -u builduser makepkg $makepkg_args + sudo -u builduser makepkg "$@" } move_products() { |