diff options
author | Eddy Petrișor <eddy.petrisor@gmail.com> | 2008-03-06 02:11:19 +0200 |
---|---|---|
committer | Eddy Petrișor <eddy.petrisor@gmail.com> | 2008-03-06 02:45:12 +0200 |
commit | 2c09082e766f6e08cfe3e2b7f0336219e029b2bd (patch) | |
tree | 9554a30fe12abb93bdff49181b83208497d89eb7 /debian | |
parent | 922da87bc9013abaebe890aedba905a6149347c9 (diff) | |
download | pbuilder-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-x | debian/pbuilder.postinst | 4 |
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" ;; |