X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F33-aptsetup;h=56355f58bb54319d495526b1937fcade5b59fac3;hb=dcc3ba1983263376ddd9528dc2e4d5f08de0ef97;hp=5e5cad7345e7d5108fb7abf3a7c879192d1bff02;hpb=cbc3a3eeb59a1e1cb6ab0815e297bc95fb85cee3;p=grml-live.git diff --git a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup index 5e5cad7..56355f5 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup @@ -1,30 +1,43 @@ -#!/bin/sh -# Filename: /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +#!/bin/bash +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/33-aptsetup # Purpose: configure Debian package management of live-system # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Sun Sep 28 20:08:30 CEST 2008 [mika] ################################################################################ set -u set -e -rm -f $target/etc/apt/sources.list +fcopy -v /etc/apt/sources.list +fcopy -v /etc/apt/sources.list.d/grml-stable.list -$ROOTCMD ln -s /etc/apt/sources.list.grml /etc/apt/sources.list +case "${SUITE:-}" in + etch) suite_class=DEBIAN_ETCH ;; + lenny) suite_class=DEBIAN_LENNY ;; + squeeze) suite_class=DEBIAN_SQUEEZE ;; + stable) suite_class=DEBIAN_STABLE ;; + testing) suite_class=DEBIAN_TESTING ;; + unstable|sid) suite_class=DEBIAN_SID ;; + wheezy) suite_class=DEBIAN_WHEEZY ;; + *) suite_class=DEBIAN_SID ;; # default to sid otherwise +esac -# if we have a devel-version or a daily snapshot -# let's activate grml-testing by default: -if [ -n "$GRML_NAME" -o -n "$RELEASENAME" ] ; then - if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild 1>/dev/null ; then - sed -i 's|^#\(.*deb.*deb.grml.org.*grml-testing\)|\1|' "$target"/etc/apt/sources.list - fi +if ! [ -r $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class ] ; then + echo "Error: could not find $FAI/files/etc/apt/sources.list.d/debian.list/$suite_class" >&2 + echo "Please provide an according sources.list template." >&2 + exit 1 fi -#if [ -r /etc/grml/fai/files/etc/apt/preferences ] ; then -# cp /etc/grml/fai/files/etc/apt/preferences $target/etc/apt/preferences -#fi +# install according sources.list, depending on deployed Debian suite +fcopy -v -c $suite_class /etc/apt/sources.list.d/debian.list + +# if we have a devel-version or a daily snapshot enable grml-testing repos: +if [ -n "$GRML_NAME" -o -n "$RELEASENAME" ] ; then + if echo "$GRML_NAME" "$RELEASENAME" | grep -e devel -e autobuild >/dev/null ; then + fcopy -v /etc/apt/sources.list.d/grml-testing.list + fi +fi ## END OF FILE ################################################################# -# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2