]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/porterbox/files/schroot-setup.d/99porterbox-extra-sources
reformat
[dsa-puppet.git] / modules / porterbox / files / schroot-setup.d / 99porterbox-extra-sources
1 #!/bin/bash
2
3 ##
4 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
5 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
6 ##
7
8 # by weasel
9
10 set -e
11
12 . "$SETUP_DATA_DIR/common-data"
13 . "$SETUP_DATA_DIR/common-functions"
14
15 if [ -f "$CHROOT_SCRIPT_CONFIG" ]; then
16     . "$CHROOT_SCRIPT_CONFIG"
17 elif [ "$STATUS" = "ok" ]; then
18     fatal "script-config file '$CHROOT_SCRIPT_CONFIG' does not exist"
19 fi
20
21
22 if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
23   SRCL="${CHROOT_PATH}/etc/apt/sources.list.d/auto.list"
24   rm -f "$SRCL"
25   mirror=${MIRROR:-cdn.debian.net}
26
27   case "${SUITE_BASE:-}" in
28     experimental)
29       echo "deb     http://$mirror/debian/ sid main" >> "$SRCL"
30       echo "deb-src http://$mirror/debian/ sid main" >> "$SRCL"
31       ;;
32     sid)
33       ;;
34     *)
35       echo "deb     http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
36       echo "deb-src http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
37       ;;
38   esac
39   echo "deb     http://$mirror/debian/ ${SUITE_BASE} main" >> "$SRCL"
40   echo "deb-src http://$mirror/debian/ ${SUITE_BASE} main" >> "$SRCL"
41
42   case "${SUITE_VARIANT:-}" in
43     backports)
44       case "${SUITE_BASE:-}" in
45         squeeze)
46           echo "deb     http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
47           echo "deb-src http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
48           ;;
49         *)
50           echo "deb     http://$mirror/debian/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
51           echo "deb-src http://$mirror/debian/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
52           ;;
53       esac
54       ;;
55   esac
56   echo "o To install build dependencies run"
57   echo "  dd-schroot-cmd -c ${SESSION_ID} apt-get update"
58   echo "  followed by build-dep/install as appropriate in the host system."
59   echo "o If you started this session with schroot -b, please do not forget to run"
60   echo "  schroot --end-session -c ${SESSION_ID}"
61   echo "  when you no longer need this environment."
62 fi