aboutsummaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorEddy Petrișor <eddy.petrisor@gmail.com>2008-03-06 02:11:19 +0200
committerEddy Petrișor <eddy.petrisor@gmail.com>2008-03-06 02:45:12 +0200
commit2c09082e766f6e08cfe3e2b7f0336219e029b2bd (patch)
tree9554a30fe12abb93bdff49181b83208497d89eb7 /debian
parent922da87bc9013abaebe890aedba905a6149347c9 (diff)
downloadpbuilder-2c09082e766f6e08cfe3e2b7f0336219e029b2bd.tar
pbuilder-2c09082e766f6e08cfe3e2b7f0336219e029b2bd.tar.gz
Make sure we don't change commented MIRRORSITE-s
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 <eddy.petrisor@gmail.com>
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/pbuilder.postinst4
1 files changed, 2 insertions, 2 deletions
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"
;;