X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F33-aptsetup;h=39af509e8db57b53c63651c16b80adf45cc5dc96;hp=03c153b717d433db26f3b99026af0f4e617c3190;hb=59296d870d632c8dc1a39fc1ff13bdbe4fbc299f;hpb=5eabf98c5e2bcb6a2a1ad5da385253acca03cdcd diff --git a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup index 03c153b..39af509 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup @@ -1,5 +1,5 @@ -#!/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/ @@ -8,73 +8,13 @@ set -e -# remove leftover from /etc/grml/fai/config/hooks/instsoft.GRMLBASE: -rm -f $target/etc/apt/sources.list.d/grml-live.list +# use snapshot.debian.org based on build date for release +if ifclass RELEASE ; then + set -u + perl -pi -e 'BEGIN { $d="'$(date +%Y%m%d)'"; } s#^(\s+)(deb.* )(.*://cdn.*?)\s+(\w+)\s+(.*)$#$1$2http://snapshot.debian.org/archive/debian/$d/ $4 $5#' \ + "${target}/etc/apt/sources.list.d/debian.list" -GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list" -DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list" - -[ -d $target/etc/apt/sources.list.d ] || mkdir $target/etc/apt/sources.list.d - -# remove any existing sources.list and inform user about the new -# /etc/apt/sources.list.d/ setup: -cat > $target/etc/apt/sources.list << EOF -##### IMPORTANT NOTE ############################################## -# The configuration file /etc/apt/sources.list has been split -# into structured files in /etc/apt/sources.list.d/ - check out: -# -# /etc/apt/sources.list.d/grml.list for the grml related repositories -# /etc/apt/sources.list.d/debian.list for official Debian repositories -# -# If you're looking for the "old" /etc/apt/sources.list file or -# need some further repositories please take a look at the file -# /etc/apt/sources.list.grml -##### IMPORTANT NOTE ############################################## -EOF - -# retrieve build information ($SUITE): -if [ -r $target/etc/grml_live_version ] ; then - . $target/etc/grml_live_version -fi - -# if we stil do not know which Debian suite we are building assume "stable" -[ -n "$SUITE" ] || SUITE="stable" - -# configure official Debian repositories: -cat > "$DEBIAN_SOURCES_LIST" << EOF -# official debian repository: - deb http://ftp.de.debian.org/debian/ $SUITE main contrib non-free - deb-src http://ftp.de.debian.org/debian/ $SUITE main contrib non-free -EOF - -# configure grml-stable repository: -cat > "$GRML_SOURCES_LIST" << EOF -# stable grml repository: - deb http://deb.grml.org/ grml-stable main - deb-src http://deb.grml.org/ grml-stable main -EOF - -ENABLE_GRML_TESTING=false -# if we have a devel-version or a daily snapshot enable 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 - ENABLE_GRML_TESTING=true - fi -fi - -if $ENABLE_GRML_TESTING ; then - cat >> "$GRML_SOURCES_LIST" << EOF -# testing/developer grml repository: - deb http://deb.grml.org/ grml-testing main - deb-src http://deb.grml.org/ grml-testing main -EOF -else # no devel/daily build: - cat >> "$GRML_SOURCES_LIST" << EOF -# testing/developer grml repository: -# deb http://deb.grml.org/ grml-testing main -# deb-src http://deb.grml.org/ grml-testing main -EOF 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