Merge remote-tracking branch 'origin/github/pr/145'
[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 -e
10
11 # use snapshot.debian.org based on build date for release
12 if ifclass RELEASE ; then
13   set -u
14   perl -pi -e 'BEGIN { $d="'$(date +%Y%m%d)'"; } s#^(\s+)(deb.* )(.*://ftp.debian.org.*?)\s+([a-z-]+)\s+(.*)$#$1$2http://snapshot.debian.org/archive/debian/$d/ $4 $5#' \
15     "${target}/etc/apt/sources.list.d/debian.list"
16 fi
17
18 ## END OF FILE #################################################################
19 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2