#!/bin/bash
-. /home/cowbuilder/bin/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"
for a in i386 amd64; do
echo "Building $a base path..."
+ 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