Loading makechrootpkg.in +11 −8 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,7 @@ m4_include(lib/common.sh) shopt -s nullglob shopt -s nullglob makepkg_args='-s --noconfirm -L --holdver' makepkg_args=(-s --noconfirm -L --holdver) repack=false repack=false update_first=false update_first=false clean_first=false clean_first=false Loading Loading @@ -46,7 +46,7 @@ usage() { echo 'command:' echo 'command:' echo ' mkarchroot <chrootdir>/root base-devel' echo ' mkarchroot <chrootdir>/root base-devel' echo '' echo '' echo "Default makepkg args: $makepkg_args" echo "Default makepkg args: ${makepkg_args[*]}" echo '' echo '' echo 'Flags:' echo 'Flags:' echo '-h This help' echo '-h This help' Loading Loading @@ -77,7 +77,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do r) passeddir="$OPTARG" ;; r) passeddir="$OPTARG" ;; I) install_pkgs+=("$OPTARG") ;; I) install_pkgs+=("$OPTARG") ;; l) copy="$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+="-$$" ;; T) temp_chroot=true; copy+="-$$" ;; h|*) usage ;; h|*) usage ;; esac esac Loading @@ -102,7 +102,7 @@ else fi fi # Pass all arguments after -- right to makepkg # Pass all arguments after -- right to makepkg makepkg_args="$makepkg_args ${*:$OPTIND}" makepkg_args+=("${@:$OPTIND}") # See if -R was passed to makepkg # See if -R was passed to makepkg for arg in "${@:OPTIND}"; do for arg in "${@:OPTIND}"; do Loading Loading @@ -265,8 +265,12 @@ EOF # This is a little gross, but this way the script is recreated every time in the # This is a little gross, but this way the script is recreated every time in the # working copy # working copy { { printf $'#!/bin/bash\n%s\n_chrootbuild %q %q || exit\n' "$(declare -f _chrootbuild)" \ printf '#!/bin/bash\n' "$makepkg_args" "$run_namcap" declare -f _chrootbuild printf '_chrootbuild' printf ' %q' "${makepkg_args[@]}" printf ' || exit\n' if $run_namcap; then if $run_namcap; then cat <<'EOF' cat <<'EOF' pacman -S --needed --noconfirm namcap pacman -S --needed --noconfirm namcap Loading Loading @@ -302,7 +306,6 @@ download_sources() { _chrootbuild() { _chrootbuild() { # This function isn't run in makechrootpkg, # This function isn't run in makechrootpkg, # so no global variables # so no global variables local makepkg_args="$1" . /etc/profile . /etc/profile export HOME=/build export HOME=/build Loading Loading @@ -338,7 +341,7 @@ _chrootbuild() { exit 1 exit 1 fi fi sudo -u builduser makepkg $makepkg_args sudo -u builduser makepkg "$@" } } move_products() { move_products() { Loading Loading
makechrootpkg.in +11 −8 Original line number Original line Diff line number Diff line Loading @@ -12,7 +12,7 @@ m4_include(lib/common.sh) shopt -s nullglob shopt -s nullglob makepkg_args='-s --noconfirm -L --holdver' makepkg_args=(-s --noconfirm -L --holdver) repack=false repack=false update_first=false update_first=false clean_first=false clean_first=false Loading Loading @@ -46,7 +46,7 @@ usage() { echo 'command:' echo 'command:' echo ' mkarchroot <chrootdir>/root base-devel' echo ' mkarchroot <chrootdir>/root base-devel' echo '' echo '' echo "Default makepkg args: $makepkg_args" echo "Default makepkg args: ${makepkg_args[*]}" echo '' echo '' echo 'Flags:' echo 'Flags:' echo '-h This help' echo '-h This help' Loading Loading @@ -77,7 +77,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do r) passeddir="$OPTARG" ;; r) passeddir="$OPTARG" ;; I) install_pkgs+=("$OPTARG") ;; I) install_pkgs+=("$OPTARG") ;; l) copy="$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+="-$$" ;; T) temp_chroot=true; copy+="-$$" ;; h|*) usage ;; h|*) usage ;; esac esac Loading @@ -102,7 +102,7 @@ else fi fi # Pass all arguments after -- right to makepkg # Pass all arguments after -- right to makepkg makepkg_args="$makepkg_args ${*:$OPTIND}" makepkg_args+=("${@:$OPTIND}") # See if -R was passed to makepkg # See if -R was passed to makepkg for arg in "${@:OPTIND}"; do for arg in "${@:OPTIND}"; do Loading Loading @@ -265,8 +265,12 @@ EOF # This is a little gross, but this way the script is recreated every time in the # This is a little gross, but this way the script is recreated every time in the # working copy # working copy { { printf $'#!/bin/bash\n%s\n_chrootbuild %q %q || exit\n' "$(declare -f _chrootbuild)" \ printf '#!/bin/bash\n' "$makepkg_args" "$run_namcap" declare -f _chrootbuild printf '_chrootbuild' printf ' %q' "${makepkg_args[@]}" printf ' || exit\n' if $run_namcap; then if $run_namcap; then cat <<'EOF' cat <<'EOF' pacman -S --needed --noconfirm namcap pacman -S --needed --noconfirm namcap Loading Loading @@ -302,7 +306,6 @@ download_sources() { _chrootbuild() { _chrootbuild() { # This function isn't run in makechrootpkg, # This function isn't run in makechrootpkg, # so no global variables # so no global variables local makepkg_args="$1" . /etc/profile . /etc/profile export HOME=/build export HOME=/build Loading Loading @@ -338,7 +341,7 @@ _chrootbuild() { exit 1 exit 1 fi fi sudo -u builduser makepkg $makepkg_args sudo -u builduser makepkg "$@" } } move_products() { move_products() { Loading