Redesign sources.list handling. Get rid of /etc/grml/fai/apt/sources.list.
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 33-aptsetup
1 #!/bin/bash
2 # Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/33-aptsetup
3 # Purpose:       configure Debian package management of live-system
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 set -u
10 set -e
11
12 fcopy -v /etc/apt/sources.list
13 fcopy -v /etc/apt/sources.list.d/grml-stable.list
14
15 case "${SUITE:-}" in
16   etch)         suite_class=DEBIAN_ETCH ;;
17   lenny)        suite_class=DEBIAN_LENNY ;;
18   squeeze)      suite_class=DEBIAN_SQUEEZE ;;
19   stable)       suite_class=DEBIAN_STABLE ;;
20   testing)      suite_class=DEBIAN_TESTING ;;
21   unstable|sid) suite_class=DEBIAN_SID ;;
22   wheezy)       suite_class=DEBIAN_WHEEZY ;;
23   *)            suite_class=DEBIAN_SID ;; # default to sid otherwise
24 esac
25
26 if ! [ -r $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class ] ; then
27   echo "Error: could not find $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class" >&2
28   echo "Please provide an according sources.list template." >&2
29   exit 1
30 fi
31
32 # install according sources.list, depending on deployed Debian suite
33 fcopy -v -c $suite_class /etc/apt/sources.list.d/debian.list
34
35 # if we have a devel-version or a daily snapshot enable grml-testing repos:
36 if [ -n "$GRML_NAME" -o -n "$RELEASENAME" ] ; then
37   if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild >/dev/null ; then
38     fcopy -v /etc/apt/sources.list.d/grml-testing.list
39   fi
40 fi
41
42 ## END OF FILE #################################################################
43 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2