The patch is now attached...

-- 
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein
diff --git a/debian/changelog b/debian/changelog
index 7ff46eb..bc1c520 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+pbuilder (0.170.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * added support for detection of the default mirror in postinst
+  * bumped versioned dependency on debhelper to (>= 4.1.16) as indicated in
+    po-debconf manual
+
+ -- Eddy Petrișor <[EMAIL PROTECTED]>  Mon, 25 Jun 2007 21:20:13 +0300
+
 pbuilder (0.170) unstable; urgency=low
 
   * add example rebuild script from Bastian Venthur
diff --git a/debian/control b/debian/control
index 7148a29..c942c13 100644
--- a/debian/control
+++ b/debian/control
@@ -3,12 +3,12 @@ Section: devel
 Priority: extra
 Maintainer: Debian pbuilder maintenance team <[EMAIL PROTECTED]>
 Uploaders: Junichi Uekawa <[EMAIL PROTECTED]>, Matt Kraai <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 4.1.0), docbook-xsl, ldp-docbook-xsl (>= 0.0.20040321-0.1), xsltproc, dpkg-dev (>= 1.13.19), dblatex, rootstrap [i386 amd64]
+Build-Depends: debhelper (>= 4.1.16), docbook-xsl, ldp-docbook-xsl (>= 0.0.20040321-0.1), xsltproc, dpkg-dev (>= 1.13.19), dblatex, rootstrap [i386 amd64], debconf|debconf-2.0, po-debconf
 Standards-Version: 3.7.2
 
 Package: pbuilder
 Architecture: all
-Depends: cdebootstrap|debootstrap, wget, gcc, debianutils (>= 1.13.1), coreutils (>= 4.5.8-1)
+Depends: cdebootstrap|debootstrap, wget, gcc, debianutils (>= 1.13.1), coreutils (>= 4.5.8-1), ${misc:Depends}
 Recommends: fakeroot, sudo, devscripts, cowdancer
 Suggests: pbuilder-uml
 Description: personal package builder for Debian packages
diff --git a/debian/pbuilder.postinst b/debian/pbuilder.postinst
new file mode 100755
index 0000000..2eb3075
--- /dev/null
+++ b/debian/pbuilder.postinst
@@ -0,0 +1,64 @@
+#!/bin/sh
+# postinst script for pbuilder
+#
+# see: dh_installdeb(1)
+
+. /usr/share/debconf/confmodule
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+
+        CONFFILE=/etc/pbuilderrc
+
+        # if there is a custom file, then we shouldn't touch it
+        CURRENTMIRROR=$(grep -E "MIRRORSITE=" "$CONFFILE" | sed 's#MIRRORSITE=##g')
+        [ "$CURRENTMIRROR" = "_" ] || exit 0
+
+        db_get pbuilder/mirrorsite
+        MIRRORSITE="$RET"
+
+        if [ "$MIRRORSITE" = "_" ]
+        then
+            MIRRORSITE=$(grep -E '^deb ' /etc/apt/sources.list | head -n 1 | awk '{print $2;}')
+            db_set pbuilder/mirrorsite "$MIRRORSITE"
+            db_input medium pbuilder/mirrorsite || true
+            db_go
+        fi
+
+        TMPFILE=`mktemp`
+        cat "$CONFFILE" | sed "s#MIRRORSITE=.*\$#MIRRORSITE=$MIRRORSITE#" > "$TMPFILE" && mv "$TMPFILE" "$CONFFILE"
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/pbuilder.templates b/debian/pbuilder.templates
new file mode 100644
index 0000000..2c36d2f
--- /dev/null
+++ b/debian/pbuilder.templates
@@ -0,0 +1,5 @@
+Template: pbuilder/mirrorsite
+Type: string
+Default: _
+_Description: Default mirror site:
+ Please enter the default mirror you want to be used by pbuilder.
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..86d57fa
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] pbuilder.templates
diff --git a/debian/po/ro.po b/debian/po/ro.po
new file mode 100644
index 0000000..fcb0d58
--- /dev/null
+++ b/debian/po/ro.po
@@ -0,0 +1,34 @@
+# translation of ro.po to Romanian
+# Romanian translations for PACKAGE package
+# Traducerea în limba română pentru pachetul PACKAGE.
+# Copyright (C) 2007 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Eddy Petrisor <[EMAIL PROTECTED]>, 2007.
+# Eddy Petrișor <[EMAIL PROTECTED]>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: ro\n"
+"Report-Msgid-Bugs-To: [EMAIL PROTECTED]"
+"POT-Creation-Date: 2007-06-25 20:56+0300\n"
+"PO-Revision-Date: 2007-06-25 21:08+0300\n"
+"Last-Translator: Eddy Petrișor <[EMAIL PROTECTED]>\n"
+"Language-Team: Romanian <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms:  nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Type: string
+#. Description
+#: ../pbuilder.templates:1001
+msgid "Default mirror site:"
+msgstr "Situl oglindă implicit:"
+
+#. Type: string
+#. Description
+#: ../pbuilder.templates:1001
+msgid "Please enter the default mirror you want to be used by pbuilder."
+msgstr "Introduceți situl oglindă implicit pe care doriți să-l folosească pbuilder."
+
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 0000000..d7a6d8c
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,29 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <[EMAIL PROTECTED]>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: [EMAIL PROTECTED]"
+"POT-Creation-Date: 2007-06-25 20:56+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
+"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: string
+#. Description
+#: ../pbuilder.templates:1001
+msgid "Default mirror site:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../pbuilder.templates:1001
+msgid "Please enter the default mirror you want to be used by pbuilder."
+msgstr ""
diff --git a/debian/rules b/debian/rules
index d69391d..40d082e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,6 +49,7 @@ binary-indep: build install
 	dh_installdocs -i
 	dh_installman pbuilder.8 pbuilderrc.5 pdebuild.1 debuild-pbuilder.1 
 	dh_installchangelogs -i
+	dh_installdebconf
 	dh_link -i
 	dh_compress -i -X.pdf
 	dh_fixperms -i
diff --git a/pbuilderrc b/pbuilderrc
index 4cf3612..216baa2 100755
--- a/pbuilderrc
+++ b/pbuilderrc
@@ -8,7 +8,7 @@ BASETGZ=/var/cache/pbuilder/base.tgz
 #EXTRAPACKAGES=gcc3.0-athlon-builder
 #export DEBIAN_BUILDARCH=athlon
 BUILDPLACE=/var/cache/pbuilder/build/
-MIRRORSITE=http://ftp.jp.debian.org/debian
+MIRRORSITE=_
 #OTHERMIRROR="deb http://www.home.com/updates/ ./"
 #export http_proxy=http://your-proxy:8080/
 USEPROC=yes

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to