From 724cc90d771d840c4579e3b2443cad21fd6fe231 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jun 2013 15:44:52 -0600 Subject: libremakepkg: add -N flag to enable networking, for distcc support --- src/chroot-tools/libremakepkg | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index cd81876..baf8015 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -174,7 +174,11 @@ build() { local user=$LIBREUSER $INCHROOT || user=nobody - run -N "$copydir" "sudo -u ${user} -- makepkg ${makepkg_args} -e" + if $NONET; then + run -N "$copydir" "sudo -u ${user} -- makepkg ${makepkg_args} -e" + else + run "$copydir" "sudo -u ${user} -- makepkg ${makepkg_args} -e" + fi } # Functions that check for issues with the build ############################### @@ -221,6 +225,9 @@ usage() { echo 'Options:' echo ' -n Name of the chroot to use' echo ' -l Name of, or absolute path to, the copy to use' + echo " -N Don't disable networking during build() or package()" + echo ' Only use this as a temporary hack to use distcc,' + echo ' until actual distcc support is added.' echo ' -R Repackage contents of the package without rebuilding' echo ' -h Show this message' } @@ -241,10 +248,12 @@ main() { INCHROOT=true fi - while getopts 'n:l:Rh' arg ; do + NONET=true + while getopts 'n:l:NRh' arg ; do case "${arg}" in n) CHROOT=$OPTARG;; l) COPY=$OPTARG;; + N) NONET=false;; R) repack=true; makepkg_args+=" -R";; h) usage; return 0;; *) usage; return 1;; -- cgit v1.2.3-54-g00ecf