]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd_adddist
BF: HTML conversion
[neurodebian.git] / tools / nd_adddist
index d6b719e27f5b8b749b548eb1d199ca2614f1baec..0d9ab920d495652de5cdb6f2ddd6ff48022cd49d 100755 (executable)
@@ -1,6 +1,22 @@
 #!/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
+
+
+. /home/neurodebian/neurodebian.git/tools/nd_cmdsettings.sh
 
 # common options
 opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache"
@@ -8,19 +24,19 @@ opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache"
 
 for a in i386 amd64; do
   echo "Building $a base path..."
-  if [ -d /home/cowbuilder/cow/${family}-${dist}-${a}.cow ]; then
-    echo "/home/cowbuilder/cow/${family}-${dist}-${a}.cow exists. Ignoring arch."
+  if [ -d ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow ]; then
+    echo "${cowbuilderroot}/cow/${family}-${dist}-${a}.cow exists. Ignoring arch."
     continue
   fi
   if [ "${family:0:3}" = "nd+" ]; then
   echo "Including NeuroDebian repository..."
-    cowbuilder --create --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts \
+    cowbuilder --create --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \
                --components "$components" \
                --mirror "$mirror" \
                --debootstrapopts --arch --debootstrapopts $a \
                --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free"
   else
-    cowbuilder --create --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts \
+    cowbuilder --create --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \
                --components "$components" \
                --mirror "$mirror" \
                --debootstrapopts --arch --debootstrapopts $a