From: Michael Prokop Date: Mon, 22 Jun 2015 11:52:46 +0000 (+0200) Subject: 33-aptsetup: improve perl regex to work with backports and perl 5.14 X-Git-Tag: v0.26.8~3 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=7cf0d67457c7a730a4cbdec28f7f9bdcd180a361 33-aptsetup: improve perl regex to work with backports and perl 5.14 The perl command line which is responsible for replacing ftp.debian.org with the according snapshot.debian.org entry produced an invalid sources.list entry with perl v5.14.2, e.g. generating: | deb http://snapshot.debian.org/archive/debian/20150622/ main deb-src http://snapshot.debian.org/archive/debian/20150622/ main with the following input: | deb http://ftp.debian.org/debian/ jessie-backports main | deb-src http://ftp.debian.org/debian/ jessie-backports main --- diff --git a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup index 10f5879..234bd1a 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup @@ -11,7 +11,7 @@ set -e # 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.* )(.*://ftp.debian.org.*?)\s+(\w+)\s+(.*)$#$1$2http://snapshot.debian.org/archive/debian/$d/ $4 $5#' \ + 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#' \ "${target}/etc/apt/sources.list.d/debian.list" fi