]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd_login
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd_login
1 #!/bin/bash
2
3 if [ -z "$1" ]; then
4 cat << EOT
5 Script to log into a particular COW and bindmount some directory.
6
7 Synopsis
8 --------
9
10   nd_login <family> <codename> <arch> [bindmountdir] [cowbuilderopts]
11
12 EOT
13 exit 1
14 fi
15
16 family=$1
17 dist=$2
18 arch=$3
19 bmdir=$4
20
21 set -e
22
23 if [ -z "$family" ]; then
24   echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
25   exit 1
26 fi
27
28 if [ -z "$dist" ]; then
29   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
30   exit 1
31 fi
32
33 if [ -z "$arch" ]; then
34   echo "You need to provide an architecture (e.g. 'i386', 'amd64')."
35   exit 1
36 fi
37
38 . /etc/neurodebian/cmdsettings.sh
39
40 # common options
41 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
42
43
44 if [ -n "bmdir" ]; then
45   options="$opts --bindmounts $bmdir"
46 else
47   options="$opts"
48 fi
49
50 cowbuilder --login \
51              --basepath ${cowbuilderroot}/cow/${family}-${dist}-${arch}.cow \
52              $options \
53              "$@"