From: Yaroslav Halchenko Date: Fri, 25 Mar 2011 19:00:25 +0000 (-0400) Subject: ENH: run nd_updatedist in parallel using parallel from moreutils X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b33bbc0e52d1d37e65500b44b9d6054600a48cbb;p=neurodebian.git ENH: run nd_updatedist in parallel using parallel from moreutils --- diff --git a/debian/control b/debian/control index 800ca0f..32aa130 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ XS-DM-Upload-Allowed: yes Package: neurodebian-dev Architecture: all Depends: ${misc:Depends}, devscripts, cowbuilder, python, neurodebian-keyring -Recommends: virtualbox-ose, virtualbox-ose-fuse, zerofree +Recommends: virtualbox-ose, virtualbox-ose-fuse, zerofree, moreutils Suggests: Description: NeuroDebian development tools neuro.debian.net sphinx website sources and development tools used by diff --git a/tools/nd_updateall b/tools/nd_updateall index aaf30c5..150d97c 100755 --- a/tools/nd_updateall +++ b/tools/nd_updateall @@ -2,9 +2,15 @@ . /etc/neurodebian/cmdsettings.sh -for d in $alldists; do - dfamily=${d%%-*} - drelease=${d##*-} - - nd_updatedist $dfamily $drelease -done +if [ -z "$SERIAL" ]; then + parallel nd_updatedist -- $alldists +else + # Original serial version, we might want to switch between the two + # upon -j + for d in $alldists; do + dfamily=${d%%-*} + drelease=${d##*-} + + nd_updatedist $dfamily $drelease + done +fi diff --git a/tools/nd_updatedist b/tools/nd_updatedist index 8a92ac8..0d95309 100755 --- a/tools/nd_updatedist +++ b/tools/nd_updatedist @@ -1,7 +1,12 @@ #!/bin/bash -family=$1 -dist=$2 +if [ $# -eq 1 ]; then + family=${1%%-*} + dist=${1##*-} +elif [ $# -eq 2 ]; then + family=$1 + dist=$2 +fi set -e @@ -15,7 +20,7 @@ if [ -z "$dist" ]; then exit 1 fi -. /etc/neurodebian/cmdsettings.sh +. /etc/neurodebian/cmdsettings.sh "$family" "$dist" # common options opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"