nd_updatedist 758 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5
if [ $# -eq 1 ]; then
  family=${1%%-*}
  dist=${1##*-}
6
elif [ $# -ge 2 ]; then
7 8 9
  family=$1
  dist=$2
fi
10 11 12 13 14 15 16 17 18 19 20 21 22

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

23
. /etc/neurodebian/cmdsettings.sh "$family" "$dist"
24 25 26 27 28 29 30 31 32 33 34 35

# common options
opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"

if [ -n "$3" ]; then
  arch=$3
else
  arch="i386 amd64"
fi

for a in $arch; do
  echo "Updating arch $a..."
36
  cowbuilder --update --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow $opts
37
done