8 if [ -z "$family" ]; then
9 echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
13 if [ -z "$dist" ]; then
14 echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
19 . /etc/neurodebian/cmdsettings.sh
22 opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache"
24 if echo $family | grep -q ubuntu; then
25 # Use ubuntu's keyring since otherwise debootstrap would fail
26 opts+=" --debootstrapopts --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg"
29 mkdir -p ${cowbuilderroot}/cow
31 for a in i386 amd64; do
32 echo "Building $a base path..."
33 cow="${cowbuilderroot}/cow/${family}-${dist}-${a}.cow"
34 if [ -d "$cow" ]; then
35 echo "${cow} exists. Ignoring arch."
38 if [ "${family:0:3}" = "nd+" ]; then
39 echo "Including NeuroDebian repository..."
40 cowbuilder --create --basepath ${cow} $opts \
41 --components "$components" \
43 --debootstrapopts --arch=$a \
44 --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free"
45 # deploy our key manually since archive with package is not yet
46 # available at this point
47 mkdir -p ${cow}/etc/apt/trusted.gpg.d
48 cp --preserve=mode {,${cow}}/etc/apt/trusted.gpg.d/neurodebian-archive-keyring.gpg
49 # Old ubuntus might not have capability to ready from that key yet,
50 # so we would need to manually add it
51 if [ $dist = 'karmic' ] || [ $dist = 'hardy' ]; then
52 chroot ${cow} bash -c "apt-get install -y --force-yes gnupg \
53 && /usr/bin/apt-key add /etc/apt/trusted.gpg.d/neurodebian-archive-keyring.gpg \
54 && /usr/bin/apt-get update"
57 cowbuilder --create --basepath ${cow} $opts \
58 --components "$components" \
60 --debootstrapopts --arch=$a