From 2c09082e766f6e08cfe3e2b7f0336219e029b2bd Mon Sep 17 00:00:00 2001 From: Eddy Petrișor Date: Thu, 6 Mar 2008 02:11:19 +0200 Subject: Make sure we don't change commented MIRRORSITE-s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hook the sed replacement to the begining of the line to make sure we're not replacing any commented out entries. Also, it is possible that the MIRRORSITE line to be preceeded by whitespace. Accept that, too. Signed-off-by: Eddy Petrișor --- debian/pbuilder.postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/pbuilder.postinst b/debian/pbuilder.postinst index d55b5c1..2b046f3 100755 --- a/debian/pbuilder.postinst +++ b/debian/pbuilder.postinst @@ -28,7 +28,7 @@ case "$1" in # if there is a custom file, then we shouldn't touch it if [ -f "$CONFFILE" ] ; then - CURRENTMIRROR=$(grep -E "^MIRRORSITE=" "$CONFFILE" | sed 's#MIRRORSITE=##g') + CURRENTMIRROR=$(grep -E "^[ ]*MIRRORSITE=" "$CONFFILE" | sed 's#MIRRORSITE=##g') if [ "$CURRENTMIRROR" ] ; then db_input low pbuilder/rewrite || [ $? = 30 ] db_go @@ -75,7 +75,7 @@ case "$1" in db_set pbuilder/mirrorsite "$MIRRORSITE" fi - sed -i "s#MIRRORSITE=.*\$#MIRRORSITE=$MIRRORSITE#" "$CONFFILE" + sed -i "s#^\s*MIRRORSITE=.*\$#MIRRORSITE=$MIRRORSITE#" "$CONFFILE" ;; -- cgit v1.2.3