[PATCH] added support for mode option

Osamu Aoki osamu at debian.org
Tue Jul 29 14:36:19 UTC 2008


These modifications added support for --mode option and documented them.
Backward compatibility is maintained if --mode option is not used.

 moved: pbuilder-loadconfig --> pbuilder-loadconfig-new
---
 README.mode                 |   58 ++++++++++++++++++++++++
 pbuilder                    |   11 +++++
 pbuilder-loadconfig         |   18 ++++----
 pbuilder-loadconfig-classic |   26 +++++++++++
 pbuilder-loadconfig-new     |   37 +++++++++++++++
 pbuilder-modules            |  105 +++++++++++++++++++++++++++++++++++++++---
 pbuilder.8                  |   17 +++++---
 pbuilderrc                  |   21 ++++++---
 8 files changed, 264 insertions(+), 29 deletions(-)
 create mode 100644 README.mode
 create mode 100644 pbuilder-loadconfig-classic
 create mode 100644 pbuilder-loadconfig-new

diff --git a/README.mode b/README.mode
new file mode 100644
index 0000000..5cc2179
--- /dev/null
+++ b/README.mode
@@ -0,0 +1,58 @@
+Note on --mode option
+
+Basic precaution:
+If you do not use --mode option, pbuilder acts the same way as before including
+some ideosyncracies it has.  If you made modification to the /etc/pbuilderrc
+beyond what debhelper generated entry and do not provide
+/etc/pbuilder/$PBMODEOPTION/pbuilderrc, this --mode option may not function as
+expected.  (~/.pbuilderrc has no effects.)
+
+The directory contents in mode/$PBMODEOPTION in source tree are installed to
+/usr/share/pbuilder/$PBMODEOPTION/apt/ and copied to chroot as /etc/apt/* when
+using --mode option.
+
+
+Rationale:
+Initial implimentation of pbuilder tries to handle special case scenarios via
+conditionals.  This is good when you have only "experimental" to be adressed.
+But when we need to deal with "...-backports", "ubunts archives", "security
+updates for testing", "volatile", "volatile-sloppy", ... this methosd is not
+simple enough.  We need to separate logic and data.  Logic should be simple.
+Data can be complicated when addressing complex problems.  Considering
+inhomogineos nature of complexity to address under pbuilder, data is the way to
+go for addressing pbuilder usage scenarios.  
+
+Thus, I propose --mode option :) as in this package.
+
+Details:
+Please note this package is meant for testing and unstable.  Once stable is
+released, codename to suite name correspondence will be wrong until first
+stable updates happens or I care to place special update verion for testing
+just before release.  (now both codenames for testing and stable backports
+point to stable backports as work around)
+
+I use "suite name" per archive Release file for Debian.
+I use "codename"   per archive Release file for Ubuntu.
+
+If you are on Debian system, you need to install ubuntu-keyring package from
+ubuntu (use dpkg -i ...) to handle Ubuntu archive. cbootstrap is compatible.
+
+Unlike classic pbuilder, --mode option always upate apt-line (or entire
+/etc/apt/*) contets overwriting with
+ * /usr/share/pbuilder/<modename>/apt/*, 
+ * /etc/pbuilder/<modename>/apt/*,
+ * ~/.pbuilder/<modename>/apt/*,
+in this sequence.  If no <modename> configuration found, it provides
+sources.list based on default.
+
+As for pbuilderrc files under --mode option
+ * /usr/share/pbuilder/pbuilderrc,  (common for all --mode)
+ * /etc/pbuilder/<modename>/pbuilderrc, (if it does not exist, /etc/pbuilder/pbuilderrc)
+ * ~/.pbuilder/<modename>/pbuilderrc,
+are read in this sequence.  The <modename> directory based configurations ovride defaults.
+
+As for hook, no special support for --mode exists.  There is E11backportkey hookscript
+in examples which can be used to import backport key to chroot. 
+
+Osamu Aoki, Mon Jun 30 14:05:30 UTC 2008
+
diff --git a/pbuilder b/pbuilder
index ed35fb4..cb700d3 100755
--- a/pbuilder
+++ b/pbuilder
@@ -20,6 +20,17 @@
 
 set -e 
 
+# MODEOPTION: Osamu Aoki <osamu at debian.org> 2008 Jul 29
+# export pbuilder operation mode specified by "--mode" option value.
+# export "" if not specified.
+if [ "$1" = "-m" ] || [ "$1" = "--mode" ] || [ "$1" = "mode" ]; then
+    PBMODEOPTION="$2"
+    shift 2
+else
+    PBMODEOPTION=""
+fi
+export PBMODEOPTION
+
 # export this so that programs know which command line
 # operation is currently done
 export PBCURRENTCOMMANDLINEOPERATION="$1"
diff --git a/pbuilder-loadconfig b/pbuilder-loadconfig
index 8367143..835662b 100644
--- a/pbuilder-loadconfig
+++ b/pbuilder-loadconfig
@@ -1,7 +1,9 @@
 #! /bin/bash 
 # this is sourced from pbuilder packages to process the optional parameters.
-#   pbuilder -- personal Debian package builder
-#   Copyright (C) 2001,2002,2006-2007 Junichi Uekawa
+# pbuilder-loadconfig switched between *-classic and *-new based on mode 
+# option existance.
+# 
+#   Copyright (C) 2008 Osamu Aoki
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -17,10 +19,8 @@
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
-for RCFILE in /usr/share/pbuilder/pbuilderrc /etc/pbuilderrc ${HOME}/.pbuilderrc; do
-    if [ -f "$RCFILE" ]; then 
-	. "$RCFILE"
-    else
-	echo "W: $RCFILE does not exist" >&2
-    fi
-done
+if [ -z "${PBMODEOPTION}" ]; then 
+    . /usr/lib/pbuilder/pbuilder-loadconfig-classic
+else
+    . /usr/lib/pbuilder/pbuilder-loadconfig-new
+fi
diff --git a/pbuilder-loadconfig-classic b/pbuilder-loadconfig-classic
new file mode 100644
index 0000000..8367143
--- /dev/null
+++ b/pbuilder-loadconfig-classic
@@ -0,0 +1,26 @@
+#! /bin/bash 
+# this is sourced from pbuilder packages to process the optional parameters.
+#   pbuilder -- personal Debian package builder
+#   Copyright (C) 2001,2002,2006-2007 Junichi Uekawa
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+for RCFILE in /usr/share/pbuilder/pbuilderrc /etc/pbuilderrc ${HOME}/.pbuilderrc; do
+    if [ -f "$RCFILE" ]; then 
+	. "$RCFILE"
+    else
+	echo "W: $RCFILE does not exist" >&2
+    fi
+done
diff --git a/pbuilder-loadconfig-new b/pbuilder-loadconfig-new
new file mode 100644
index 0000000..81ff8f5
--- /dev/null
+++ b/pbuilder-loadconfig-new
@@ -0,0 +1,37 @@
+#! /bin/bash 
+# this is sourced from pbuilder packages to process the optional parameters.
+# this loads apt file from directory specified by --mode
+#   pbuilder -- personal Debian package builder
+#   Copyright (C) 2001,2002,2006-2007 Junichi Uekawa
+#   Copyright (C) 2008 Osamu Aoki
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+# Set pbuiler with pbuilderrc file in consistent location.
+for RCFILE in "/usr/share/pbuilder/pbuilderrc" "/etc/pbuilder/${PBMODEOPTION}/pbuilderrc" "${HOME}/.pbuilder/${PBMODEOPTION}/pbuilderrc" ; do
+    if [ -f "$RCFILE" ]; then 
+	. "$RCFILE"
+	echo "I: Loading  $RCFILE"
+    else
+	echo "I: Skipping $RCFILE (not found)"
+    	if [ "/etc/pbuilder/${PBMODEOPTION}/pbuilderrc" = "${RCFILE}" ] && \
+            [ -n "${PBMODEOPTION}" ] && \
+            [ -f "/etc/pbuilder/pbuilderrc" ]; then
+            . "/etc/pbuilder/pbuilderrc"
+	    echo "I: Loading  /etc/pbuilder/pbuilderrc"
+        fi
+    fi
+done
+
diff --git a/pbuilder-modules b/pbuilder-modules
index 26626f9..13bd658 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -24,27 +24,27 @@ pbuilder - a personal builder
 Copyright 2001-2007 Junichi Uekawa
 Distributed under GNU Public License version 2 or later
 
-pbuilder [operation] [pbuilder-options]
+pbuilder [mode] [operation] [pbuilder-options]
 pdebuild [pdebuild-options] -- [pbuilder-options]
 
 command lines:
-pbuilder --create [--basetgz base.tgz-path] [--distribution etch|lenny|sid|experimental]
+pbuilder [--mode modeop] --create [--basetgz base.tgz-path] [--distribution etch|lenny|sid|experimental]
   Creates a base.tgz
 
-pbuilder --update [--basetgz base.tgz-path] [--distribution etch|lenny|sid|experimental]
+pbuilder [--mode modeop] --update [--basetgz base.tgz-path] [--distribution etch|lenny|sid|experimental]
   Updates a base.tgz
 
-pbuilder --build [--basetgz base.tgz-path] pbuilder_2.2.0-1.dsc
+pbuilder [--mode modeop] --build [--basetgz base.tgz-path] pbuilder_2.2.0-1.dsc
   Builds using the base.tgz. Requires a .dsc filename
 
-pbuilder --clean
+pbuilder [--mode modeop] --clean
   Cleans the temporal build directory.
 
-pbuilder --login
-pbuilder --execute -- [command] [command-options]
+pbuilder [--mode modeop] --login
+pbuilder [--mode modeop] --execute -- [command] [command-options]
   Logs in to the build environment and execute command.
 
-pbuilder --dumpconfig
+pbuilder [--mode modeop] --dumpconfig
   Dumps configuration information to stdout for debugging.
 
 pbuilder-options:
@@ -311,6 +311,13 @@ function saveaptcache_umountproc_cleanbuildplace () {
 }
 
 function installaptlines (){
+    if [ -z "${PBMODEOPTION}" ]; then
+        installaptlines_classic
+    else
+        installaptlines_new
+    fi
+}
+function installaptlines_classic (){
     echo "  -> Installing apt-lines"
     rm -f "$BUILDPLACE"/etc/apt/sources.list
     if [ -z "$DISTRIBUTION" ]; then
@@ -355,6 +362,88 @@ EOF
     fi
 }
 
+function installaptlines_new (){
+    echo "  -> Installing apt-lines and other apt-directory contents"
+    # Set decent defaults
+    if [ -z "$MIRRORSITE" ] ; then
+        MIRRORSITE="http://ftp.us.debian.org/debian/"
+    fi
+    if [ -n "$OTHERMIRROR" ]; then 
+    	# /usr/share/pbuilder/${PBMODEOPTION}/apt/sources.list /etc/pbuilder/${PBMODEOPTION}/apt/sources.list and ~/.pbuilder/${PBMODEOPTION}/apt/sources.list on host are used to set the equivalent.
+	echo "The variable OTHERMIRROR  has no effect, when using --mode" >&2
+	echo "    $OTHERMIRROR" >&2
+    fi
+    if [ -z "$DISTRIBUTION" ]; then
+        # It should not come here : --mode "" goes -classic
+	echo "Distribution not specified, please specify" >&2
+	exit 1
+    fi
+    if [ -n "$EXPERIMENTAL" ]; then
+    	# This should not happen
+	echo "The variable EXPERIMENTAL=$EXPERIMENTAL should not happen, when using --mode" >&2
+	exit 1
+    fi
+    if [ -z "$COMPONENTS" ] ; then
+	COMPONENTS="main"
+    fi
+    if [ -n "$APTCONFDIR" ]; then 
+    	# /usr/share/pbuilder/${PBMODEOPTION}/apt/ /etc/pbuilder/${PBMODEOPTION}/apt/ and ~/.pbuilder/${PBMODEOPTION}/apt/ on host are used.
+	echo "The variable APTCONFDIR=$APTCONFDIR has no effect, when using --mode" >&2
+    fi
+    # force to create new /etc/apt/sources.list
+    rm -f "$BUILDPLACE"/etc/apt/sources.list
+    if [ ! -d "$BUILDPLACE"/etc/apt/apt.conf.d ]; then
+	echo "  -> Create /etc/apt/apt.conf.d/ inside chroot"
+	mkdir -p "$BUILDPLACE"/etc/apt/apt.conf.d
+    fi
+    # Copy /etc/apt contents into cheroot environment with files matching $PBMODEOPTION (--mode value).
+    for ETCAPT in /usr/share/pbuilder/${PBMODEOPTION}/apt /etc/pbuilder/${PBMODEOPTION}/apt ${HOME}/.pbuilder/${PBMODEOPTION}/apt ; do
+        if [ -d "$ETCAPT" ]; then
+	    # This not only updates sources.list, preferences within chroot
+	    # but copies all files in the configuration directories into chroot.
+	    # This opens door to use file:// in sources.list
+	    echo "I: Loading  $ETCAPT"
+	    cp -vfdR  $ETCAPT/* "$BUILDPLACE"/etc/apt/
+        else
+	    echo "I: Skipping $ETCAPT (not found)"
+        fi
+    done
+
+    # If all skipped, provide decent default for sources.list:
+    if [ ! -f "$BUILDPLACE"/etc/apt/sources.list ]; then
+	cat > "$BUILDPLACE"/etc/apt/sources.list << EOF
+deb @@@MIRRORSITE@@@ @@@DISTRIBUTION@@@ @@@COMPONENTS@@@
+EOF
+    fi
+    mv -f "$BUILDPLACE"/etc/apt/sources.list "$BUILDPLACE"/etc/apt/sources.list.tmp
+    sed -e "s#@@@MIRRORSITE@@@#$MIRRORSITE#" -e "s#@@@DISTRIBUTION@@@#$DISTRIBUTION#" -e "s#@@@COMPONENTS@@@#$COMPONENTS#" \
+        < "$BUILDPLACE"/etc/apt/sources.list.tmp    > "$BUILDPLACE"/etc/apt/sources.list
+    rm -f "$BUILDPLACE"/etc/apt/sources.list.tmp
+
+    # always need this for not using Recommends (preference is used for experimental)
+    if [ -f "$BUILDPLACE"/etc/apt/apt.conf.d/15pbuilder ]; then
+    # configure /etc/apt.conf.d/15pbuilder if missing
+    cat > "$BUILDPLACE"/etc/apt/apt.conf.d/15pbuilder <<EOF
+APT::Install-Recommends "false";
+EOF
+    fi
+    if [ -f "$BUILDPLACE"/etc/apt/sources.list ]; then
+    	echo "I: ==== Using /etc/apt/sources.list          ===="
+    	cat "$BUILDPLACE"/etc/apt/sources.list
+    else
+    	echo "I: ==== Missing /etc/apt/sources.list        ===="
+    fi
+    if [ -f "$BUILDPLACE"/etc/apt/preferences ]; then
+        echo "I: ==== Using /etc/apt/preferences           ===="
+        cat "$BUILDPLACE"/etc/apt/preferences
+    else
+    	echo "I: ==== Missing /etc/apt/preferences         ===="
+    fi
+    #echo "I: ==== Using /etc/apt/apt.conf.d/15pbuilder ===="
+    #cat "$BUILDPLACE"/etc/apt/apt.conf.d/15pbuilder
+    echo "I: =============================================="
+}
+
 function copy_local_configuration () {
     echo " -> copying local configuration"
     for a in hosts hostname resolv.conf; do 
diff --git a/pbuilder.8 b/pbuilder.8
index 3a36bcf..3b3d825 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -2,17 +2,17 @@
 .SH NAME
 pbuilder \- personal package builder
 .SH SYNOPSIS
-.BI "pbuilder --create [" "options" "]"
+.BI "pbuilder [--mode opmode] --create [" "options" "]"
 .PP
-.BI "pbuilder --update [" "options" "]"
+.BI "pbuilder [--mode opmode] --update [" "options" "]"
 .PP
-.BI "pbuilder --build [" "options" "] " ".dsc-file"
+.BI "pbuilder [--mode opmode] --build [" "options" "] " ".dsc-file"
 .PP
-.BI "pbuilder --execute [" "options" "] -- " "script [" "script options" "]"
+.BI "pbuilder [--mode opmode] --execute [" "options" "] -- " "script [" "script options" "]"
 .PP
-.BI "pbuilder --clean"
+.BI "pbuilder [--mode opmode] --clean"
 .PP
-.BI "pbuilder --login [" "options" "]"
+.BI "pbuilder [--mode opmode] --login [" "options" "]"
 .SH "DESCRIPTION"
 Front end program to the 
 .B "pbuilder"
@@ -22,6 +22,11 @@ and building Debian package in the chroot environment.
 .SH "COMMANDS"
 
 .TP
+.B "--mode opmode" | "-m opmode"
+Swiches pbuilder configuration to use a different set of configuration files specified by
+.B "opmode" .
+
+.TP
 .B "--create"
 Creates a 
 .B "base.tgz" 
diff --git a/pbuilderrc b/pbuilderrc
index 1445acb..d2ea3a1 100755
--- a/pbuilderrc
+++ b/pbuilderrc
@@ -1,30 +1,39 @@
 # 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 editing.
+# /etc/pbuilderrc is the one meant for editing. (classic)
+#
+#  /etc/pbuilder/${PBMODEOPTION}/pbuilderrc
+#  ~/.pbuilder/${PBMODEOPTION}/pbuilderrc
+#   are the one meant for editing with --mode option.
 #
 # read pbuilderrc.5 document for notes on specific options.
 
-BASETGZ=/var/cache/pbuilder/base.tgz
+BASETGZ=/var/cache/pbuilder/${PBMODEOPTION}/base.tgz
 #EXTRAPACKAGES=gcc3.0-athlon-builder
 #export DEBIAN_BUILDARCH=athlon
-BUILDPLACE=/var/cache/pbuilder/build/
+BUILDPLACE=/var/cache/pbuilder/${PBMODEOPTION}/build/
+# This is used only for classic and --mode for Debian sites
+# it could be overidden by first line of <mode>/sources.list
 MIRRORSITE=http://cdn.debian.net/debian
+
+# Do not set OTHERMIRROR with --mode
 #OTHERMIRROR="deb http://www.home.com/updates/ ./"
+
 #export http_proxy=http://your-proxy:8080/
 USEPROC=yes
 USEDEVPTS=yes
 USEDEVFS=no
-BUILDRESULT=/var/cache/pbuilder/result/
+BUILDRESULT=/var/cache/pbuilder/${PBMODEOPTION}/result/
 
 # specifying the distribution forces the distribution on "pbuilder update"
 #DISTRIBUTION=lenny
 # specifying the components of the distribution
 COMPONENTS="main"
 #specify the cache for APT 
-APTCACHE="/var/cache/pbuilder/aptcache/"
+APTCACHE="/var/cache/pbuilder/${PBMODEOPTION}/aptcache/"
 APTCACHEHARDLINK="yes"
 REMOVEPACKAGES="lilo"
-#HOOKDIR="/usr/lib/pbuilder/hooks"
+#HOOKDIR="/usr/lib/pbuilder/${PBMODEOPTION}/hooks"
 HOOKDIR=""
 
 # make debconf not interact with user
-- 
1.5.6.3


--HlL+5n6rz5pIUxbD
Content-Type: text/x-diff; charset=iso-8859-1
Content-Disposition: attachment; filename="0002-updated-build-scripts.patch"
Content-Transfer-Encoding: quoted-printable

=46rom 536e0f20259df33b23a1cd2c59121b09d84144ff Mon Sep 17 00:00:00 2001
=46rom: Osamu Aoki <osamu at debian.org>
Date: Tue, 29 Jul 2008 23:42:28 +0900
Subject: [PATCH] updated build scripts

  RELEASE_LIST: release name definitions
  moved: debian/pbuilder.links --> debian/pbuilder.links.in
---
 Makefile                 |   20 ++++++++++++++++++--
 RELEASE_LIST             |    4 ++++
 debian/changelog         |   10 ++++++++++
 debian/docs              |    1 +
 debian/pbuilder.links    |    1 -
 debian/pbuilder.links.in |   10 ++++++++++
 debian/rules             |    7 ++++++-
 7 files changed, 49 insertions(+), 4 deletions(-)
 create mode 100644 RELEASE_LIST
 delete mode 100644 debian/pbuilder.links
 create mode 100644 debian/pbuilder.links.in

diff --git a/Makefile b/Makefile
index b5be113..9b2ecdb 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ SHELLCODES=3Dpbuilder-buildpackage \
 	pbuilder-uml-checkparams \
 	pbuilder-createbuildenv \
 	pbuilder-loadconfig \
+	pbuilder-loadconfig-classic \
+	pbuilder-loadconfig-new \
 	pbuilder-modules \
 	pbuilder-runhooks \
 	pbuilder-satisfydepends-classic \
@@ -28,6 +30,15 @@ SHELLCODES=3Dpbuilder-buildpackage \
 	pdebuild-user-mode-linux \
 	pdebuild-internal
=20
+#
+# To add new supported mode, add it here and place them under apt/ directo=
ry, so they will be installed.
+#
+SUPPORTEDMODE=3D$(subst mode/, , $(wildcard mode/*))
+#
+# Conversion rule
+#
+include RELEASE_LIST
+
 check:
 	set -e;
 	for A in $(SHELLCODES); do \
@@ -56,6 +67,8 @@ install:
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/bin
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/lib/pbuilder
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/pbuilder
+	for x in $(SUPPORTEDMODE); do $(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/p=
builder/$$x ; done
+	for x in $(SUPPORTEDMODE); do $(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/p=
builder/$$x/apt ; done
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/doc/pbuilder/examples
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/doc/pbuilder/examples/rebuild
 	$(INSTALL_DIRECTORY) $(DESTDIR)/usr/share/doc/pbuilder/examples/pbuilder-=
test
@@ -68,6 +81,8 @@ install:
 	$(INSTALL_EXECUTABLE) pbuilder-createbuildenv $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_EXECUTABLE) pbuilder-updatebuildenv $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_EXECUTABLE) pbuilder-loadconfig $(DESTDIR)/usr/lib/pbuilder/
+	$(INSTALL_EXECUTABLE) pbuilder-loadconfig-classic $(DESTDIR)/usr/lib/pbui=
lder/
+	$(INSTALL_EXECUTABLE) pbuilder-loadconfig-new $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_EXECUTABLE) pbuilder-runhooks $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_EXECUTABLE) pbuilder-checkparams $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_EXECUTABLE) pdebuild-checkparams $(DESTDIR)/usr/lib/pbuilder/
@@ -79,8 +94,7 @@ install:
 	$(INSTALL_EXECUTABLE) pbuilder-user-mode-linux $(DESTDIR)/usr/bin
 	$(INSTALL_EXECUTABLE) pdebuild-user-mode-linux $(DESTDIR)/usr/bin
 	$(INSTALL_EXECUTABLE) debuild-pbuilder $(DESTDIR)/usr/bin
-
-	#install aptitude as the default satisfydepends=20
+	#install aptitude as the default satisfydepends
 	$(INSTALL_EXECUTABLE) pbuilder-satisfydepends-aptitude $(DESTDIR)/usr/lib=
/pbuilder/pbuilder-satisfydepends
 	$(INSTALL_EXECUTABLE) pbuilder-satisfydepends-classic $(DESTDIR)/usr/lib/=
pbuilder/
 	$(INSTALL_EXECUTABLE) pbuilder-satisfydepends-gdebi $(DESTDIR)/usr/lib/pb=
uilder/
@@ -90,6 +104,8 @@ install:
 	$(INSTALL_EXECUTABLE) pbuilder-satisfydepends-funcs $(DESTDIR)/usr/lib/pb=
uilder/
 	$(INSTALL_EXECUTABLE) pdebuild-internal $(DESTDIR)/usr/lib/pbuilder/
 	$(INSTALL_FILE) pbuilderrc $(DESTDIR)/usr/share/doc/pbuilder/examples
+	for x in $(SUPPORTEDMODE); do sed $(CONV) <mode/$$x/sources.list >$(DESTD=
IR)/usr/share/pbuilder/$$x/apt/sources.list ; done
+	for x in $(SUPPORTEDMODE); do sed $(CONV) <mode/$$x/preferences >$(DESTDI=
R)/usr/share/pbuilder/$$x/apt/preferences ; done
 	$(INSTALL_FILE) bash_completion.pbuilder $(DESTDIR)/etc/bash_completion.d=
/pbuilder
 	$(INSTALL_FILE) pbuilderrc $(DESTDIR)/usr/share/pbuilder
 	$(INSTALL_FILE) pbuilder-uml.conf $(DESTDIR)/etc/pbuilder
diff --git a/RELEASE_LIST b/RELEASE_LIST
new file mode 100644
index 0000000..e789669
--- /dev/null
+++ b/RELEASE_LIST
@@ -0,0 +1,4 @@
+#
+# Conversion rule
+#
+CONV=3D-e "s/@@@oldstable@@@/sarge/g" -e "s/@@@stable@@@/etch/g" -e "s/@@@=
testing@@@/lenny/g" -e "s/@@@unstable@@@/sid/g"
diff --git a/debian/changelog b/debian/changelog
index f7aa97f..2891aa8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+pbuilder (0.181+osamu1) UNRELEASED; urgency=3Dlow
+
+  * Pbuilder to configure itself based on the target distribution via
+    --mode option.  (closes: #398404)
+  * Good support for Ubuntu archive with --mode option.
+  * Alternative default mirror value from sources.list under --mode=20
+    option.
+
+ -- Osamu Aoki <osamu at debian.org>  Thu, 26 Jun 2008 01:56:50 +0900
+
 pbuilder (0.181) unstable; urgency=3Dlow
=20
   [ Esko Araj=E4rvi ]
diff --git a/debian/docs b/debian/docs
index 9eb0398..368d7cd 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1,4 +1,5 @@
 README
+README.mode
 AUTHORS
 THANKS
 debian/TODO
diff --git a/debian/pbuilder.links b/debian/pbuilder.links
deleted file mode 100644
index 59ac2d4..0000000
--- a/debian/pbuilder.links
+++ /dev/null
@@ -1 +0,0 @@
-/etc/pbuilderrc /etc/pbuilder/pbuilderrc
\ No newline at end of file
diff --git a/debian/pbuilder.links.in b/debian/pbuilder.links.in
new file mode 100644
index 0000000..b33f385
--- /dev/null
+++ b/debian/pbuilder.links.in
@@ -0,0 +1,10 @@
+/etc/pbuilderrc /etc/pbuilder/pbuilderrc
+/usr/share/pbuilder/unstable/apt /usr/share/pbuilder/sid/apt
+/usr/share/pbuilder/testing/apt /usr/share/pbuilder/@@@testing@@@/apt
+/usr/share/pbuilder/testing-proposed-updates/apt /usr/share/pbuilder/@@@te=
sting@@@-proposed-updates/apt
+/usr/share/pbuilder/stable-backports/apt /usr/share/pbuilder/@@@testing@@@=
-backports/apt
+/usr/share/pbuilder/stable/apt /usr/share/pbuilder/@@@stable@@@/apt
+/usr/share/pbuilder/stable-backports/apt /usr/share/pbuilder/@@@stable@@@-=
backports/apt
+/usr/share/pbuilder/stable-proposed-updates/apt /usr/share/pbuilder/@@@sta=
ble@@@-proposed-updates/apt
+/usr/share/pbuilder/oldstable-proposed-updates/apt /usr/share/pbuilder/@@@=
oldstable@@@-proposed-updates/apt
+
diff --git a/debian/rules b/debian/rules
index 40d082e..6fb9a22 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,12 +7,16 @@
=20
 # This is the debhelper compatability version to use.
 ARCH=3D$(shell dpkg-architecture -qDEB_HOST_ARCH)
+#
+# Conversion rule
+#
+include RELEASE_LIST
=20
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
 	# Add here commands to configure the package.
-
+	sed $(CONV) < debian/pbuilder.links.in > debian/pbuilder.links
 	touch configure-stamp
=20
 build: configure-stamp build-stamp=20
@@ -28,6 +32,7 @@ clean:
=20
 	# Add here commands to clean up after the build process.
 	-$(MAKE) clean
+	-rm debian/pbuilder.links
=20
 	dh_clean
=20
--=20
1.5.6.3


--HlL+5n6rz5pIUxbD
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0003-added-example-to-add-archive-key-within-chroot.patch"



More information about the Pbuilder-maint mailing list