tag 598316 +patch
usertags 598316 +patch-supplied
thanks

Attached are three patches fixing the three issues reported in this bug. 
Hopefully it should be fairly self-explanatory which one is for which.

- Matt
>From 3631bcda0a9bf0011d02268942ebc7756fd03ada Mon Sep 17 00:00:00 2001
From: Matt Palmer <mpal...@hezmatt.org>
Date: Mon, 13 Dec 2010 17:04:45 +1100
Subject: [PATCH] Allow arbitrary whitespace in sources.list.  Ref: #598316

An overly restrictive regex means that people who like very neat
sources.list files get penalised.  Not any more.
---
 debian/pbuilder.config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/pbuilder.config b/debian/pbuilder.config
index 2e50015..d98f5f6 100755
--- a/debian/pbuilder.config
+++ b/debian/pbuilder.config
@@ -67,7 +67,7 @@ EOF
             MIRRORSITE=$(
                 ( [ -f /etc/apt/sources.list ] && cat /etc/apt/sources.list || true ;
                   [ -f $SRCLISTDIR/*.sources.list ] && cat $SRCLISTDIR/*.sources.list || true ) \
-                | grep -E '^deb (ftp|http):' | head -n 1 | awk '{print $2;}'
+                | grep -E '^deb[[:space:]]+(ftp|http):' | head -n 1 | awk '{print $2;}'
                 )
             while [ -z "$MIRRORSITE" ] ; do
                 db_input high pbuilder/nomirror || true
-- 
1.5.6.5

>From d344ee770c72486040b48ed713fcf0321ada0fb7 Mon Sep 17 00:00:00 2001
From: Matt Palmer <mpal...@hezmatt.org>
Date: Mon, 13 Dec 2010 17:09:41 +1100
Subject: [PATCH] Fix typo in pbuilder.config comment.  Ref: #598316

---
 debian/pbuilder.config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/pbuilder.config b/debian/pbuilder.config
index d98f5f6..999949c 100755
--- a/debian/pbuilder.config
+++ b/debian/pbuilder.config
@@ -42,7 +42,7 @@ case "$1" in
            cat <<EOF > "$CONFFILE"
 # this is your configuration file for pbuilder.
 # the file in /usr/share/pbuilder/pbuilderrc is the default template.
-# /etc/pbuilderrc is the one meant for overwritting defaults in
+# /etc/pbuilderrc is the one meant for overwriting defaults in
 # the default template
 #
 # read pbuilderrc.5 document for notes on specific options.
-- 
1.5.6.5

>From 8f555316ed91c10c5b0a3b720491c1665b8611cb Mon Sep 17 00:00:00 2001
From: Matt Palmer <mpal...@hezmatt.org>
Date: Tue, 14 Dec 2010 07:55:47 +1100
Subject: [PATCH] Allow preseeding of pbuilder/mirrorsite.  Closes: #598316

As far as I can tell, the db_set calls all through pbuilder.config were
mostly to get around the default value -- but there's no need for it, given
that it will be set correctly if we're non-interactive anyway.

I've tested this patch in all the different ways I can think of, to exercise
all the code paths, and it works in the way I'd expect (a sensible-looking,
valid mirror is set).  Absent a formal test plan, I can't be any more
confident that it does the right thing in all situations.
---
 debian/pbuilder.config    |    6 ------
 debian/pbuilder.templates |    1 -
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/debian/pbuilder.config b/debian/pbuilder.config
index 999949c..e07db08 100755
--- a/debian/pbuilder.config
+++ b/debian/pbuilder.config
@@ -35,8 +35,6 @@ case "$1" in
             else
                 # no MIRRORSITE line found in the pbuilderrc file
                 echo "MIRRORSITE=$PLACEHOLDER" >> "$CONFFILE"
-                MIRRORSITE=""
-                db_set pbuilder/mirrorsite ""
             fi
         else
            cat <<EOF > "$CONFFILE"
@@ -48,12 +46,8 @@ case "$1" in
 # read pbuilderrc.5 document for notes on specific options.
 EOF
             echo "MIRRORSITE=$PLACEHOLDER" >> "$CONFFILE"
-            MIRRORSITE=""
-            db_set pbuilder/mirrorsite ""
         fi
 
-        db_get pbuilder/mirrorsite
-        [ "$RET" = "$PLACEHOLDER" ] && db_set pbuilder/mirrorsite "" || true
         db_input medium pbuilder/mirrorsite || [ $? = 30 ]
         db_go
 
diff --git a/debian/pbuilder.templates b/debian/pbuilder.templates
index 3f80003..68440b7 100644
--- a/debian/pbuilder.templates
+++ b/debian/pbuilder.templates
@@ -1,6 +1,5 @@
 Template: pbuilder/mirrorsite
 Type: string
-Default: http://cdn.debian.net/debian
 _Description: Default mirror site:
  Please enter the default mirror you want to be used by pbuilder.
  .
-- 
1.5.6.5

Reply via email to