Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/makechrootpkg.in b/makechrootpkg.in
- index d81be84..d045c0a 100644
- --- a/makechrootpkg.in
- +++ b/makechrootpkg.in
- @@ -51,6 +51,7 @@ usage() {
- echo '-n Run namcap on the package'
- echo '-T Build in a temporary directory'
- echo '-U Run makepkg as a specified user'
- + echo '-N Disable network during build'
- exit 1
- }
- @@ -311,6 +312,7 @@ main() {
- clean_first=false
- run_namcap=false
- temp_chroot=false
- + disable_network=false
- chrootdir=
- passeddir=
- makepkg_user=
- @@ -325,7 +327,7 @@ main() {
- [[ -z "$copy" || $copy = root ]] && copy=copy
- src_owner=${SUDO_USER:-$USER}
- - while getopts 'hcur:I:l:nTD:d:U:' arg; do
- + while getopts 'hcur:I:l:nTD:d:U:N' arg; do
- case "$arg" in
- c) clean_first=true ;;
- D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
- @@ -337,6 +339,7 @@ main() {
- n) run_namcap=true; makepkg_args+=(--install) ;;
- T) temp_chroot=true; copy+="-$$" ;;
- U) makepkg_user="$OPTARG" ;;
- + N) disable_network=true ;;
- h|*) usage ;;
- esac
- done
- @@ -415,12 +418,30 @@ main() {
- prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir" "$run_namcap"
- - if arch-nspawn "$copydir" \
- - --bind="$PWD:/startdir" \
- - --bind="$SRCDEST:/srcdest" \
- - "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
- - /chrootbuild "${makepkg_args[@]}"
- - then
- + # Download dependencies
- + if [[ "$disable_network" == true ]]; then
- + stat_busy "Installing build dependencies before disabling network"
- + arch-nspawn "$copydir" \
- + --bind="$PWD:/startdir" \
- + --bind="$SRCDEST:/srcdest" \
- + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
- + sudo -u builduser bash -c 'cd /startdir; makepkg -soe --noconfirm'
- + stat_done
- +
- + arch-nspawn "$copydir" \
- + --bind="$PWD:/startdir" \
- + --bind="$SRCDEST:/srcdest" \
- + --private-network \
- + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
- + /chrootbuild "${makepkg_args[@]}"
- + else
- + arch-nspawn "$copydir" \
- + --bind="$PWD:/startdir" \
- + --bind="$SRCDEST:/srcdest" \
- + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
- + /chrootbuild "${makepkg_args[@]}"
- + fi
- + if (( $? == 0 )); then
- move_products "$copydir" "$src_owner"
- else
- (( ret += 1 ))
Add Comment
Please, Sign In to add comment