From 7ed913ae27fe872aaa8b2cca4f906849ce1ca541 Mon Sep 17 00:00:00 2001 From: Eddy Petrisor Date: Mon, 25 Jun 2007 19:40:48 +0300 Subject: a crude first version of the default mirror selection code --- debian/pbuilder.postinst | 20 ++++++++++++++++++++ debian/pbuilder.templates | 5 +++++ debian/rules | 1 + 3 files changed, 26 insertions(+) create mode 100755 debian/pbuilder.postinst create mode 100644 debian/pbuilder.templates diff --git a/debian/pbuilder.postinst b/debian/pbuilder.postinst new file mode 100755 index 0000000..f326182 --- /dev/null +++ b/debian/pbuilder.postinst @@ -0,0 +1,20 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule + +CONFFILE=/etc/pbuilderrc + +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 + db_go +fi + +TMPFILE=`mktemp` +cat "$CONFFILE" | sed "s#MIRRORSITE=.*\$#MIRRORSITE=$MIRRORSITE#" > "$TMPFILE" && mv "$TMPFILE" "$CONFFILE" + 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/rules b/debian/rules index d69391d..c56a534 100755 --- a/debian/rules +++ b/debian/rules @@ -72,6 +72,7 @@ ifneq (,$(findstring ${ARCH},i386 amd64)) dh_gencontrol -a dh_md5sums -a dh_builddeb -a + dh_installdebconf endif -- cgit v1.2.3