]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd_updatedist
Adapt all tools to the new config location and install them.
[neurodebian.git] / tools / nd_updatedist
index 81f511fe8ec203c120be222b3e435cbb2a856b31..8a92ac8601858cbdf271811dd840e8784431425b 100755 (executable)
@@ -1,6 +1,21 @@
 #!/bin/bash
 
-. /home/cowbuilder/neurodebian.git/tools/nd_cmdsettings.sh
+family=$1
+dist=$2
+
+set -e
+
+if [ -z "$family" ]; then
+  echo "you need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the neurodebian repository."
+  exit 1
+fi
+
+if [ -z "$dist" ]; then
+  echo "you need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
+  exit 1
+fi
+
+. /etc/neurodebian/cmdsettings.sh
 
 # common options
 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
@@ -13,5 +28,5 @@ fi
 
 for a in $arch; do
   echo "Updating arch $a..."
-  cowbuilder --update --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts
+  cowbuilder --update --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts
 done