Tighten replacement operation for SNAPSHOT class
authorChristian Hofstaedtler <ch@grml.org>
Sun, 11 Dec 2011 03:09:06 +0000 (04:09 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Sun, 11 Dec 2011 03:10:30 +0000 (04:10 +0100)
Only match not-commented cdn.debian.net URLs. This way SNAPSHOT
should only ever affect the repository URL that was the build
source.
It's still a hack.

etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup

index c8c348f..c38a28e 100755 (executable)
@@ -10,8 +10,9 @@ set -e
 
 if ifclass SNAPSHOT ; then
   set -u
-  debianlist="${target}/etc/apt/sources.list.d/debian.list"
-  perl -pi -e 's#(deb.* )(.*://.*?)( .*)$#$1http://snapshot.debian.org/archive/debian/'$(date +%Y%m%d)'/$3#' ${debianlist}
+  perl -pi -e 'BEGIN { $d="'$(date +%Y%m%d)'"; } s#^(\s+)(deb.* )(.*://cdn.*?)(
+  .*)$#$1$2http://snapshot.debian.org/archive/debian/$d/$4#' \
+    "${target}/etc/apt/sources.list.d/debian.list"
 fi
 
 ## END OF FILE #################################################################