Merge remote-tracking branch 'origin/master' into staging
[mirror/dsa-puppet.git] / modules / schroot / 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 [ "$CHROOT_PROFILE" = "dsa" ] || [ "$CHROOT_PROFILE" = "buildd-dsa" ] || exit 0
13
14 . "$SETUP_DATA_DIR/common-data"
15 . "$SETUP_DATA_DIR/common-functions"
16
17 if [ -f "${CHROOT_SCRIPT_CONFIG:-}" ]; then
18     . "$CHROOT_SCRIPT_CONFIG"
19 elif [ -f "$CHROOT_PROFILE_DIR/config" ]; then
20     . "$CHROOT_PROFILE_DIR/config"
21 else
22     fatal "Cannot find config script"
23 fi
24
25 suite_alias="$SUITE_BASE"
26 case "$SUITE_ARCH" in
27     kfreebsd-*)
28         case "$SUITE_BASE" in
29             jessie)
30                 suite_alias="$SUITE_BASE-kfreebsd"
31             ;;
32         esac
33         ;;
34 esac
35
36 if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
37   SRCL="${CHROOT_PATH}/etc/apt/sources.list.d/auto.list"
38   rm -f "$SRCL"
39   mirror=${MIRROR:-http://ftp.debian.org/debian}
40   debugmirror=${DEBUGMIRROR:-http://debug.mirrors.debian.org/debian-debug/}
41
42   case "$SUITE_ARCH" in
43     ppc64)
44       case "${SUITE_BASE:-}" in
45         experimental)
46           echo "deb     http://ftp.de.debian.org/debian-ports experimental main" >> "$SRCL"
47           echo "deb-src $mirror experimental main" >> "$SRCL"
48
49           echo "deb     http://ftp.de.debian.org/debian-ports sid main" >> "$SRCL"
50           echo "deb-src $mirror sid main" >> "$SRCL"
51
52           echo "deb     http://ftp.de.debian.org/debian-ports unreleased main" >> "$SRCL"
53           echo "deb-src http://ftp.de.debian.org/debian-ports unreleased main" >> "$SRCL"
54           ;;
55         sid)
56           echo "deb     http://ftp.de.debian.org/debian-ports sid main" >> "$SRCL"
57           echo "deb-src $mirror sid main" >> "$SRCL"
58
59           echo "deb     http://ftp.de.debian.org/debian-ports unreleased main" >> "$SRCL"
60           echo "deb-src http://ftp.de.debian.org/debian-ports unreleased main" >> "$SRCL"
61           ;;
62         *)
63           fatal "Unexpected suite base $SUITE_BASE"
64           ;;
65       esac
66       ;;
67     *)
68       case "${SUITE_BASE:-}" in
69         experimental)
70           echo "deb     $mirror sid main" >> "$SRCL"
71           echo "deb-src $mirror sid main" >> "$SRCL"
72
73           echo "deb     $debugmirror sid-debug main" >> "$SRCL"
74           echo "deb-src $debugmirror sid-debug main" >> "$SRCL"
75           ;;
76         sid)
77           ;;
78         *)
79           echo "deb     http://security.debian.org/ ${suite_alias}/updates main" >> "$SRCL"
80           echo "deb-src http://security.debian.org/ ${suite_alias}/updates main" >> "$SRCL"
81           ;;
82       esac
83       case "${SUITE_BASE:-}" in
84         experimental|sid|stretch|buster|bullseye|bookworm)
85           echo "deb     $debugmirror ${suite_alias}-debug main" >> "$SRCL"
86           echo "deb-src $debugmirror ${suite_alias}-debug main" >> "$SRCL"
87           ;;
88       esac
89
90       echo "deb     $mirror ${suite_alias} main" >> "$SRCL"
91       echo "deb-src $mirror ${suite_alias} main" >> "$SRCL"
92
93       case "${SUITE_VARIANT:-}" in
94         backports)
95           echo "deb     $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
96           echo "deb-src $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
97           ;;
98       esac
99       ;;
100   esac
101   echo "o To install build dependencies run"
102   echo "  dd-schroot-cmd -c ${SESSION_ID} apt-get update"
103   echo "  followed by build-dep/install as appropriate in the host system."
104   echo "o If you started this session with schroot -b, please do not forget to run"
105   echo "  schroot --end-session -c ${SESSION_ID}"
106   echo "  when you no longer need this environment."
107 fi