]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd_adddist
Adapt all tools to the new config location and install them.
[neurodebian.git] / tools / nd_adddist
1 #!/bin/bash
2
3 family=$1
4 dist=$2
5
6 set -e
7
8 if [ -z "$family" ]; then
9   echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
10   exit 1
11 fi
12
13 if [ -z "$dist" ]; then
14   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
15   exit 1
16 fi
17
18
19 . /etc/neurodebian/cmdsettings.sh
20
21 # common options
22 opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache"
23
24
25 for a in i386 amd64; do
26   echo "Building $a base path..."
27   if [ -d ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow ]; then
28     echo "${cowbuilderroot}/cow/${family}-${dist}-${a}.cow exists. Ignoring arch."
29     continue
30   fi
31   if [ "${family:0:3}" = "nd+" ]; then
32   echo "Including NeuroDebian repository..."
33     cowbuilder --create --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \
34                --components "$components" \
35                --mirror "$mirror" \
36                --debootstrapopts --arch --debootstrapopts $a \
37                --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free"
38   else
39     cowbuilder --create --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts \
40                --components "$components" \
41                --mirror "$mirror" \
42                --debootstrapopts --arch --debootstrapopts $a
43   fi
44 done