#398404 simple syntax to support multiple build environments

#398404#5
Date:
2006-11-13 16:31:39 UTC
From:
To:
 While I'm trying to sleep at night, I sometimes find myself thinking
 about new features in pbuilder.

 It's obvious that people want to use different pbuilder setups for
 different distributions (see e.g. #373807).  pbuilder has access to
 debian/changelog which has the target distribution, so it should be
 possible to over configuration based on the target distribution.  For
 example, if it's experimental or *-backports, pbuilder should switch
 it's SATISFYDEPENDS invocation.

#398404#10
Date:
2008-06-07 02:58:24 UTC
From:
To:
It is waist of typing to specify long --basetgz [basetgz-location] and
other options on command line or editing ${HOME}/.pbuilderrc contents.

There should be an easier way to switch configuration files.  This is
useful not only for bpo but also experimental support etc.

I propose to add "--use suffix" commadline which is placed before any
other options.  Anyway, see my patch.  This provides fix not only for
this bug 398404 but also addresses other wishlist bugs.
 373807 (one base.tzg per distribution by "--use dists")
 324000 (At least with new "I: ...", it is obvious which files are sourced)
 272354 (Something described here by Loïc Minier and normal sid build
         can be done cleanly switched with this patch.  Also original
         bug report wish may be addressed by "--use stable"
         configuration specifying OTHERDISTRIBUTION pointing to security
         archive Of course, we need to implement OTHERDISTRIBUTION which
         is not yet done in here.)

Oh, I did not include but it may be interesting to create several
prepackaged files such as /usr/share/pbuilder/pbuilderrc.bpo where
OTHERMIRROR and  OTHERDISTRIBUTION (this needs to be done) are specified
to point to security and bpo while DISTRIBUTION is etch.

Since how to cleanly implement OTHERDISTRIBUTION for each OTHERMIRROR, I
leave that as next action item and provide very basic switching
functionality now.  OTHERDISTRIBUTIO will be next step.

Osamu

#398404#15
Date:
2008-06-07 02:58:24 UTC
From:
To:
It is waist of typing to specify long --basetgz [basetgz-location] and
other options on command line or editing ${HOME}/.pbuilderrc contents.

There should be an easier way to switch configuration files.  This is
useful not only for bpo but also experimental support etc.

I propose to add "--use suffix" commadline which is placed before any
other options.  Anyway, see my patch.  This provides fix not only for
this bug 398404 but also addresses other wishlist bugs.
 373807 (one base.tzg per distribution by "--use dists")
 324000 (At least with new "I: ...", it is obvious which files are sourced)
 272354 (Something described here by Loïc Minier and normal sid build
         can be done cleanly switched with this patch.  Also original
         bug report wish may be addressed by "--use stable"
         configuration specifying OTHERDISTRIBUTION pointing to security
         archive Of course, we need to implement OTHERDISTRIBUTION which
         is not yet done in here.)

Oh, I did not include but it may be interesting to create several
prepackaged files such as /usr/share/pbuilder/pbuilderrc.bpo where
OTHERMIRROR and  OTHERDISTRIBUTION (this needs to be done) are specified
to point to security and bpo while DISTRIBUTION is etch.

Since how to cleanly implement OTHERDISTRIBUTION for each OTHERMIRROR, I
leave that as next action item and provide very basic switching
functionality now.  OTHERDISTRIBUTIO will be next step.

Osamu

#398404#20
Date:
2008-06-07 04:06:59 UTC
From:
To:
Hi,

As I see pbuilder-modules and think about it, $MIRROR and $OTHERMIRROR
are 2 totally different interface to create /e/a/sources.list within
pbuilder chroot.

It is easy to create security update line with $OTHERMIRROR

OTHERMIRROR="http://security.debian.org/ stable/updates main contrib"

So with "--use stable" and /usr/share/pbuilder/pbuilderrc.stable
we can use security archive.  Of course, we need to provide it though.

The more I think about it, this "--use suffix" is nice feature.

#398404#23
Date:
2008-06-07 04:06:59 UTC
From:
To:
Hi,

As I see pbuilder-modules and think about it, $MIRROR and $OTHERMIRROR
are 2 totally different interface to create /e/a/sources.list within
pbuilder chroot.

It is easy to create security update line with $OTHERMIRROR

OTHERMIRROR="http://security.debian.org/ stable/updates main contrib"

So with "--use stable" and /usr/share/pbuilder/pbuilderrc.stable
we can use security archive.  Of course, we need to provide it though.

The more I think about it, this "--use suffix" is nice feature.

#398404#28
Date:
2008-06-08 15:12:19 UTC
From:
To:
As I read more about pbuilder source to get bpo optimized environment,
it looks to me what I propose initially is not scalable.

Also, handling of EXPERIMENTAL in pbuilder-createbuildenv seems to be
too ad-hoc.

Instead of playing with suffix, pbuilder-loadconfig should do something
like:

for RCFILE in /usr/share/pbuilder/${PBCONFIGSUFFIX}/pbuilderrc /etc/pbuilder/${PBCONFIGSUFFIX}/pbuilderrc ${HOME}/.pbuilder/${PBCONFIGSUFFIX}/pbuilderrc; do


Here, "classic" as default value for --use option value: ${PBCONFIGSUFFIX}

symlink as /etc/pbuilderrc -> /etc/classic/pbuilderrc

/usr/share/pbuilder/classic/pbuilderrc (current one)

/usr/share/pbuilder/<use-target>/pbuilderrc (all special preset cases)
/usr/share/pbuilder/<use-target>/etc/apt/*  (all special preset cases)

Here, all <use-target>/pbuilderrc files set APTDIR to
/usr/share/pbuilder/<use-target>/etc/apt/

It could use some symlink to sae space as long as readlink is used
inscript.

System configuration overide files shall be
/etc/pbuilder/<use-target>/pbuilderrc
/etc/pbuilder/<use-target>/etc/apt/*  (populate with right contents)

Here, all /etc/pbuilder/<use-target>/pbuilderrc files set APTDIR to
/usr/share/pbuilder/<use-target>/etc/apt/

/etc/pbuilder/classic/pbuilderrc should also source
${HOME}/.pbuilderrc for compatibility.

Then make [ -n APTDIR ] condition to copy sources.list etc.

This should make it simpler and visible for user.  This makes it weasy
for user to figure out how pbuilder works...

Anyway, do not do tis now for sure.  Too rough.

#398404#33
Date:
2008-06-29 13:43:51 UTC
From:
To:
Hi,

I have been locally making modified pbuilder which supports all Ubuntu
and Debian.  It is getting some success.  Missing support of sarge in
cdebootstrap is a problem I found in this course.

Now, everything happens under /var/cache/pbuilder/<mode> for
each --mode option.

This should address: 373807 272354

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,

As for pbuilderrc files under --mode option
 * /usr/share/pbuilder/pbuilderrc,  (common for all --mode)
 * /etc/pbuilder/<modename>/pbuilderrc,
 * ~/.pbuilder/<modename>/pbuilderrc,
are read but the <modename> directory based configurations ovride some setting.

(hook may need a bit more integration)

I needed to "dpkg -i ubuntu-keyring_2008.03.04_all.deb" and packahge
modification.  It know a bit of cleaning though.  I upload current one to

http://people.debian.org/~osamu/package/

Here is how it works, e.g., hardy. (packages properly chacked by gnupg
all the time.)

 $ sudo pbuilder --mode hardy --create
I: Loading  /usr/share/pbuilder/pbuilderrc
I: Skipping /etc/pbuilder/hardy/pbuilderrc (not found)
I: Skipping /home/osamu/.pbuilder/hardy/pbuilderrc (not found)
Building the build environment
 -> running cdebootstrap to get hardy from http://archive.ubuntu.com/ubuntu/
/usr/bin/cdebootstrap
P: Retrieving Release
P: Retrieving Release.gpg
P: Validating Release
I: Good signature from "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>"
P: Parsing Release
P: Retrieving Packages.gz
P: Validating Packages.gz
P: Parsing Packages
P: Retrieving gcc-4.2-base
P: Validating gcc-4.2-base
P: Retrieving libgcc1
P: Validating libgcc1
P: Retrieving libc6
P: Validating libc6
P: Retrieving libstdc++6
P: Validating libstdc++6

 ... snip ...

O: Selecting previously deselected package dpkg.
O: dpkg: regarding .../dpkg_1.14.16.6ubuntu3_amd64.deb containing dpkg, pre-dependency problem:
O:  dpkg pre-depends on coreutils (>= 5.93-1)
O: dpkg: warning - ignoring pre-dependency problem !
O: dpkg: regarding .../dpkg_1.14.16.6ubuntu3_amd64.deb containing dpkg, pre-dependency problem:
O:  dpkg pre-depends on libc6 (>= 2.7-1)
O: dpkg: warning - ignoring pre-dependency problem !

 ... snip ...

O: Processing triggers for libc6 ...
O: ldconfig deferred processing now taking place
P: Deconfiguring helper cdebootstrap-helper-apt
O: (Reading database ... 8846 files and directories currently installed.)
O: Removing cdebootstrap-helper-apt ...
O: Purging configuration files for cdebootstrap-helper-apt ...
O: Reading package lists...
O:
P: Deconfiguring helper cdebootstrap-helper-makedev
O: (Reading database ... 8845 files and directories currently installed.)
O: Removing cdebootstrap-helper-makedev ...
O: Purging configuration files for cdebootstrap-helper-makedev ...
P: Writing apt sources.list
P: Writing hosts
P: Writing resolv.conf
 -> debootstrap finished
 -> copying local configuration
  -> Installing apt-lines and other apt-directory contents
I: Loading  /usr/share/pbuilder/hardy/apt
`/usr/share/pbuilder/hardy/apt/preferences' -> `/var/cache/pbuilder/hardy/build//2459/etc/apt/preferences'
`/usr/share/pbuilder/hardy/apt/sources.list' -> `/var/cache/pbuilder/hardy/build//2459/etc/apt/sources.list'
I: Skipping /etc/pbuilder/hardy/apt (not found)
I: Skipping /home/osamu/.pbuilder/hardy/apt (not found)
I: ==== Using /etc/apt/sources.list          ====
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
I: ==== Using /etc/apt/preferences           ====
I: ==============================================
Refreshing the base.tgz
 -> upgrading packages
 -> mounting /proc filesystem
 -> mounting /dev/pts filesystem
 -> policy-rc.d already exists
Get:1 http://archive.ubuntu.com hardy Release.gpg [191B]
Get:2 http://archive.ubuntu.com hardy Release [65.9kB]
Get:3 http://archive.ubuntu.com hardy/main Packages [1173kB]
Get:4 http://archive.ubuntu.com hardy/restricted Packages [6397B]
Get:5 http://archive.ubuntu.com hardy/universe Packages [4257kB]
Get:6 http://archive.ubuntu.com hardy/multiverse Packages [174kB]
Fetched 5676kB in 26s (216kB/s)
Reading package lists... Done
dpkg - warning: ignoring request to remove lilo which isn't installed.
Obtaining the cached apt archive contents
find: `/var/cache/pbuilder/hardy/aptcache/': No such file or directory
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
dpkg-dev is already the newest version.
apt is already the newest version.
The following extra packages will be installed:
  libcwidget3 libncursesw5 libsigc++-2.0-0c2a
Suggested packages:
  debtags tasksel libcwidget-dev
Recommended packages:
  aptitude-doc-en aptitude-doc libparse-debianchangelog-perl libgpmg1
The following NEW packages will be installed:
  aptitude libcwidget3 libncursesw5 libsigc++-2.0-0c2a
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.

 ... snip ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Copying back the cached apt archive contents
 -> new cache content libcwidget3_0.5.8-1ubuntu1_amd64.deb added
 -> new cache content aptitude_0.4.9-2ubuntu5_amd64.deb added
 -> new cache content libncursesw5_5.6+20071124-1ubuntu2_amd64.deb added
 -> new cache content libsigc++-2.0-0c2a_2.0.17-2ubuntu3_amd64.deb added
 -> unmounting dev/pts filesystem
 -> unmounting proc filesystem
 -> creating base tarball [/var/cache/pbuilder/hardy/base.tgz]
 -> cleaning the build env
    -> removing directory /var/cache/pbuilder/hardy/build//2459 and its subdirectories

#398404#36
Date:
2008-06-29 13:43:51 UTC
From:
To:
Hi,

I have been locally making modified pbuilder which supports all Ubuntu
and Debian.  It is getting some success.  Missing support of sarge in
cdebootstrap is a problem I found in this course.

Now, everything happens under /var/cache/pbuilder/<mode> for
each --mode option.

This should address: 373807 272354

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,

As for pbuilderrc files under --mode option
 * /usr/share/pbuilder/pbuilderrc,  (common for all --mode)
 * /etc/pbuilder/<modename>/pbuilderrc,
 * ~/.pbuilder/<modename>/pbuilderrc,
are read but the <modename> directory based configurations ovride some setting.

(hook may need a bit more integration)

I needed to "dpkg -i ubuntu-keyring_2008.03.04_all.deb" and packahge
modification.  It know a bit of cleaning though.  I upload current one to

http://people.debian.org/~osamu/package/

Here is how it works, e.g., hardy. (packages properly chacked by gnupg
all the time.)

 $ sudo pbuilder --mode hardy --create
I: Loading  /usr/share/pbuilder/pbuilderrc
I: Skipping /etc/pbuilder/hardy/pbuilderrc (not found)
I: Skipping /home/osamu/.pbuilder/hardy/pbuilderrc (not found)
Building the build environment
 -> running cdebootstrap to get hardy from http://archive.ubuntu.com/ubuntu/
/usr/bin/cdebootstrap
P: Retrieving Release
P: Retrieving Release.gpg
P: Validating Release
I: Good signature from "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>"
P: Parsing Release
P: Retrieving Packages.gz
P: Validating Packages.gz
P: Parsing Packages
P: Retrieving gcc-4.2-base
P: Validating gcc-4.2-base
P: Retrieving libgcc1
P: Validating libgcc1
P: Retrieving libc6
P: Validating libc6
P: Retrieving libstdc++6
P: Validating libstdc++6

 ... snip ...

O: Selecting previously deselected package dpkg.
O: dpkg: regarding .../dpkg_1.14.16.6ubuntu3_amd64.deb containing dpkg, pre-dependency problem:
O:  dpkg pre-depends on coreutils (>= 5.93-1)
O: dpkg: warning - ignoring pre-dependency problem !
O: dpkg: regarding .../dpkg_1.14.16.6ubuntu3_amd64.deb containing dpkg, pre-dependency problem:
O:  dpkg pre-depends on libc6 (>= 2.7-1)
O: dpkg: warning - ignoring pre-dependency problem !

 ... snip ...

O: Processing triggers for libc6 ...
O: ldconfig deferred processing now taking place
P: Deconfiguring helper cdebootstrap-helper-apt
O: (Reading database ... 8846 files and directories currently installed.)
O: Removing cdebootstrap-helper-apt ...
O: Purging configuration files for cdebootstrap-helper-apt ...
O: Reading package lists...
O:
P: Deconfiguring helper cdebootstrap-helper-makedev
O: (Reading database ... 8845 files and directories currently installed.)
O: Removing cdebootstrap-helper-makedev ...
O: Purging configuration files for cdebootstrap-helper-makedev ...
P: Writing apt sources.list
P: Writing hosts
P: Writing resolv.conf
 -> debootstrap finished
 -> copying local configuration
  -> Installing apt-lines and other apt-directory contents
I: Loading  /usr/share/pbuilder/hardy/apt
`/usr/share/pbuilder/hardy/apt/preferences' -> `/var/cache/pbuilder/hardy/build//2459/etc/apt/preferences'
`/usr/share/pbuilder/hardy/apt/sources.list' -> `/var/cache/pbuilder/hardy/build//2459/etc/apt/sources.list'
I: Skipping /etc/pbuilder/hardy/apt (not found)
I: Skipping /home/osamu/.pbuilder/hardy/apt (not found)
I: ==== Using /etc/apt/sources.list          ====
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
I: ==== Using /etc/apt/preferences           ====
I: ==============================================
Refreshing the base.tgz
 -> upgrading packages
 -> mounting /proc filesystem
 -> mounting /dev/pts filesystem
 -> policy-rc.d already exists
Get:1 http://archive.ubuntu.com hardy Release.gpg [191B]
Get:2 http://archive.ubuntu.com hardy Release [65.9kB]
Get:3 http://archive.ubuntu.com hardy/main Packages [1173kB]
Get:4 http://archive.ubuntu.com hardy/restricted Packages [6397B]
Get:5 http://archive.ubuntu.com hardy/universe Packages [4257kB]
Get:6 http://archive.ubuntu.com hardy/multiverse Packages [174kB]
Fetched 5676kB in 26s (216kB/s)
Reading package lists... Done
dpkg - warning: ignoring request to remove lilo which isn't installed.
Obtaining the cached apt archive contents
find: `/var/cache/pbuilder/hardy/aptcache/': No such file or directory
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
dpkg-dev is already the newest version.
apt is already the newest version.
The following extra packages will be installed:
  libcwidget3 libncursesw5 libsigc++-2.0-0c2a
Suggested packages:
  debtags tasksel libcwidget-dev
Recommended packages:
  aptitude-doc-en aptitude-doc libparse-debianchangelog-perl libgpmg1
The following NEW packages will be installed:
  aptitude libcwidget3 libncursesw5 libsigc++-2.0-0c2a
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.

 ... snip ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Copying back the cached apt archive contents
 -> new cache content libcwidget3_0.5.8-1ubuntu1_amd64.deb added
 -> new cache content aptitude_0.4.9-2ubuntu5_amd64.deb added
 -> new cache content libncursesw5_5.6+20071124-1ubuntu2_amd64.deb added
 -> new cache content libsigc++-2.0-0c2a_2.0.17-2ubuntu3_amd64.deb added
 -> unmounting dev/pts filesystem
 -> unmounting proc filesystem
 -> creating base tarball [/var/cache/pbuilder/hardy/base.tgz]
 -> cleaning the build env
    -> removing directory /var/cache/pbuilder/hardy/build//2459 and its subdirectories

#398404#41
Date:
2008-06-29 15:55:05 UTC
From:
To:
Hi,

creating chroot needs only Debian and Ubuntu keys ... that has been
addressed by cdebootstrap and loading ubuntu keyring.

But updating chroot needs backports.org key within chroot.

I created E11backportkey

#!/bin/sh
apt-get -y install wget
wget -O - http://backports.org/debian/archive.key | apt-key add -
apt-get -y update
apt-get -y dist-upgrade

This seems to work...

I still have problem installing debhelper .... ?  I see there were
sarge-backports but there is no etch-backports.  I guess I need to
install from testing and hope it does not break.  Time to sleep.

Osamu

#398404#44
Date:
2008-06-29 15:55:05 UTC
From:
To:
Hi,

creating chroot needs only Debian and Ubuntu keys ... that has been
addressed by cdebootstrap and loading ubuntu keyring.

But updating chroot needs backports.org key within chroot.

I created E11backportkey

#!/bin/sh
apt-get -y install wget
wget -O - http://backports.org/debian/archive.key | apt-key add -
apt-get -y update
apt-get -y dist-upgrade

This seems to work...

I still have problem installing debhelper .... ?  I see there were
sarge-backports but there is no etch-backports.  I guess I need to
install from testing and hope it does not break.  Time to sleep.

Osamu

#398404#49
Date:
2008-07-29 16:33:35 UTC
From:
To:
Hi,

Here are my latest patches to do --mode option.

This starts at debian/0.181.

I have not merged with current master for easy review.

Osamu

#398404#52
Date:
2008-07-29 16:33:35 UTC
From:
To:
Hi,

Here are my latest patches to do --mode option.

This starts at debian/0.181.

I have not merged with current master for easy review.

Osamu

#398404#57
Date:
2008-07-30 07:23:13 UTC
From:
To:
Hi,

I was wondering at this patch, is it possible to have a normal manpage
/ Docbook documentation update instead of a 'README.mode' that kind of
stands out and looks weird?

#398404#60
Date:
2008-07-30 07:23:13 UTC
From:
To:
Hi,

I was wondering at this patch, is it possible to have a normal manpage
/ Docbook documentation update instead of a 'README.mode' that kind of
stands out and looks weird?

#398404#65
Date:
2008-07-30 13:43:32 UTC
From:
To:
That should be better. 'README.mode' was my design note to some extent.

I will update it.

Osamu

#398404#68
Date:
2008-07-30 13:43:32 UTC
From:
To:
That should be better. 'README.mode' was my design note to some extent.

I will update it.

Osamu

#398404#73
Date:
2008-08-02 16:46:51 UTC
From:
To:
Here it is.  Just apply on the top of previous patch.

As I read documention more, I realize this is refinment of FAQ 8
example.  Now no more --othermirror.

Osamu

#398404#76
Date:
2008-08-02 16:46:51 UTC
From:
To:
Here it is.  Just apply on the top of previous patch.

As I read documention more, I realize this is refinment of FAQ 8
example.  Now no more --othermirror.

Osamu

#398404#81
Date:
2008-08-03 01:32:52 UTC
From:
To:
Hi,

I merged with Loic Minier's changes.

Osamu

#398404#84
Date:
2008-08-03 01:32:52 UTC
From:
To:
Hi,

I merged with Loic Minier's changes.

Osamu

#398404#89
Date:
2008-08-03 03:09:59 UTC
From:
To:
Hi,

I should have test-build package before submitting patch.  In order to
build package, this patch is needed on the top of previous patched.

By the way, mutt encode patch files in many formts. I hope it is cleanly
working on your side.  If you give me commit right, I will start branch
to reduce mail exchange.  (No rush... I will be off line next 7
 days.)

Osamu

#398404#92
Date:
2008-08-03 03:09:59 UTC
From:
To:
Hi,

I should have test-build package before submitting patch.  In order to
build package, this patch is needed on the top of previous patched.

By the way, mutt encode patch files in many formts. I hope it is cleanly
working on your side.  If you give me commit right, I will start branch
to reduce mail exchange.  (No rush... I will be off line next 7
 days.)

Osamu

#398404#97
Date:
2008-08-05 02:37:24 UTC
From:
To:
Hi,

It's quite hard to review your patch this way; what's the cumulative
diff against HEAD?

I've added you to the pbuilder group on alioth; however I am worried
that your patch may be adding too much complexity to pbuilder
codebase.  If I incorporate this patch to pbuilder, I'd like to do the
same for cowbuilder, and I want to keep the implementation as clean as
possible.

#398404#100
Date:
2008-08-05 02:37:24 UTC
From:
To:
Hi,

It's quite hard to review your patch this way; what's the cumulative
diff against HEAD?

I've added you to the pbuilder group on alioth; however I am worried
that your patch may be adding too much complexity to pbuilder
codebase.  If I incorporate this patch to pbuilder, I'd like to do the
same for cowbuilder, and I want to keep the implementation as clean as
possible.

#398404#105
Date:
2008-08-10 17:08:35 UTC
From:
To:
Hi,

I had  impression that sending git formatted mail is easier for merging
in branch... I guess not.

No it started at debian/0.181 tag.

I see your point.

Aside from documentation updates, this is relatively simple patch.
The core of code change was:

 pbuilder                    |   11 +++++
 pbuilder-loadconfig         |   18 ++++----
 pbuilder-loadconfig-classic |   26 +++++++++++
 pbuilder-loadconfig-new     |   37 +++++++++++++++
 pbuilder-modules            |  105 +++++++++++++++++++++++++++++++++++++++---

 * pbuilder:
    * patched to accepts --mode option and pass it as $PBMODEOPTION
 * pbuilder-loadconfig:
    * Old contents are moved to pbuilder-loadconfig-classic
    * Now this switches between pbuilder-loadconfig-classic and
      pbuilder-loadconfig-new based on use of --mode option.
    * pbuilder-loadconfig-new uses configuration file in different
      locations based on --mode option.
 * pbuilder-modules:
    * Old "function installaptlines" is moved to "function
      installaptlines_classic".
    * Now "function installaptlines"  switches between "function
      installaptlines_classic" and "function installaptlines_new"
    * "function installaptlines_new" does data driven apt setup based on
      --mode option.
 * mode/*:
    default data for apt setup under --mode option usage

I kept 100% compatibility if --mode option is not used. (Although it is
not so pretty).

As for cowdancer, it looks to me very straight forward to add --mode
option and pass that to pbuilder.

Anyway I will make new branch from current HEAD for easy review later.

Osamu

#398404#108
Date:
2008-08-10 17:08:35 UTC
From:
To:
Hi,

I had  impression that sending git formatted mail is easier for merging
in branch... I guess not.

No it started at debian/0.181 tag.

I see your point.

Aside from documentation updates, this is relatively simple patch.
The core of code change was:

 pbuilder                    |   11 +++++
 pbuilder-loadconfig         |   18 ++++----
 pbuilder-loadconfig-classic |   26 +++++++++++
 pbuilder-loadconfig-new     |   37 +++++++++++++++
 pbuilder-modules            |  105 +++++++++++++++++++++++++++++++++++++++---

 * pbuilder:
    * patched to accepts --mode option and pass it as $PBMODEOPTION
 * pbuilder-loadconfig:
    * Old contents are moved to pbuilder-loadconfig-classic
    * Now this switches between pbuilder-loadconfig-classic and
      pbuilder-loadconfig-new based on use of --mode option.
    * pbuilder-loadconfig-new uses configuration file in different
      locations based on --mode option.
 * pbuilder-modules:
    * Old "function installaptlines" is moved to "function
      installaptlines_classic".
    * Now "function installaptlines"  switches between "function
      installaptlines_classic" and "function installaptlines_new"
    * "function installaptlines_new" does data driven apt setup based on
      --mode option.
 * mode/*:
    default data for apt setup under --mode option usage

I kept 100% compatibility if --mode option is not used. (Although it is
not so pretty).

As for cowdancer, it looks to me very straight forward to add --mode
option and pass that to pbuilder.

Anyway I will make new branch from current HEAD for easy review later.

Osamu

#398404#113
Date:
2008-08-11 20:11:02 UTC
From:
To:
Hi,

rebasing to HEAD is simple; if you are up-to-date, 'git-rebase origin'
should re-apply your patches against the origin (the main pbuilder
tree), so that your changes will stand out.

At Mon, 11 Aug 2008 02:08:35 +0900,
Osamu Aoki wrote:

#398404#116
Date:
2008-08-11 20:11:02 UTC
From:
To:
Hi,

rebasing to HEAD is simple; if you are up-to-date, 'git-rebase origin'
should re-apply your patches against the origin (the main pbuilder
tree), so that your changes will stand out.

At Mon, 11 Aug 2008 02:08:35 +0900,
Osamu Aoki wrote:

#398404#121
Date:
2010-01-06 16:08:19 UTC
From:
To:
Hi,

(CCed to bug reporters of related bugs: 384031, 373807)

I finally got to create branch for mode option.  It is "osamu" and
merged from the latest Loic's commit to "master" now.  It has been
committed as branch to the pbuilder git repo.

The optional mode argument, e.g. "--mode mode1", is a way to support
multiple build environments. It creates pbuilder working environment
where each mode, e.g. "mode1", keeps all its data (chroot, build
results, aptcache, ...) under /var/cache/pbuilder/mode1/ .

If we attempt to support complicated chroot configurations from command
line options, it becomes too complicated and hard to learn.  It will be
unmaintainable too.  We can see some glimpses with the support of
experimental.  People may ask what about security support of testing,
volatile, .....  This mode option solves these problems.

Keep it simple and stupid.

The work flow with the mode option, e.g. "mode1" goes as:

$ sudo pbuilder --mode mode1 --create
$ sudo pbuilder --mode mode1 --login --save-after-login
... interactive configuration of chroot
^D
$ pdebuild -- --mode mode1

Alternatively, you may use --no-targz instead of --save-after-login .
(these are tested)

If any automatic configuration is needed, I guess use --exec instead of
--login with some hook script. (this is not tested)

This is a clean up and minimal change version of my old proposal.

Commit is in 2 steps.
 1st. critical changes
 2nd. associated changes

I admit it requires change to cowdancer if cowdancer also want to use
this --mode thing.  I also admit this needs a lot of testing.

Unlike last time I discussed, this is current and usable.

I hope this is interesting to you.

Good night.
                       Osamu

#398404#124
Date:
2010-01-06 16:08:19 UTC
From:
To:
Hi,

(CCed to bug reporters of related bugs: 384031, 373807)

I finally got to create branch for mode option.  It is "osamu" and
merged from the latest Loic's commit to "master" now.  It has been
committed as branch to the pbuilder git repo.

The optional mode argument, e.g. "--mode mode1", is a way to support
multiple build environments. It creates pbuilder working environment
where each mode, e.g. "mode1", keeps all its data (chroot, build
results, aptcache, ...) under /var/cache/pbuilder/mode1/ .

If we attempt to support complicated chroot configurations from command
line options, it becomes too complicated and hard to learn.  It will be
unmaintainable too.  We can see some glimpses with the support of
experimental.  People may ask what about security support of testing,
volatile, .....  This mode option solves these problems.

Keep it simple and stupid.

The work flow with the mode option, e.g. "mode1" goes as:

$ sudo pbuilder --mode mode1 --create
$ sudo pbuilder --mode mode1 --login --save-after-login
... interactive configuration of chroot
^D
$ pdebuild -- --mode mode1

Alternatively, you may use --no-targz instead of --save-after-login .
(these are tested)

If any automatic configuration is needed, I guess use --exec instead of
--login with some hook script. (this is not tested)

This is a clean up and minimal change version of my old proposal.

Commit is in 2 steps.
 1st. critical changes
 2nd. associated changes

I admit it requires change to cowdancer if cowdancer also want to use
this --mode thing.  I also admit this needs a lot of testing.

Unlike last time I discussed, this is current and usable.

I hope this is interesting to you.

Good night.
                       Osamu

#398404#129
Date:
2010-01-07 13:19:08 UTC
From:
To:
Hi,

This is my proposed changes:
http://git.debian.org/?p=pbuilder/pbuilder.git;a=shortlog;h=refs/heads/osamu

I hope this is now easier to review.

Minor correction on my previous mail.
-------x8 The work flow with the mode option, e.g. "mode1" goes as: $ sudo pbuilder --mode mode1 --create $ sudo pbuilder --mode mode1 --login --save-after-login ... interactive configuration of chroot ^D $ pdebuild --mode mode1 -------x8 Please note there is no "--" for pdebuild. This is how it needs to be used. (as documented in patched manpage) Osamu ------------------------------------------------------------------ PS: This can be fixed by changing inside pdebuild and others too. NOW in source as: ${PBUILDERROOTCMD} ${PDEBUILD_PBUILDER} --build ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" --d ebbuildopts "" --debbuildopts "${DEBBUILDOPTS}" "$@" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc REPLACE with: ${PBUILDERROOTCMD} ${PDEBUILD_PBUILDER} "$@" --build ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" --debbuildopts "" --debbuildopts "${DEBBUILDOPTS}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc But I did not do this. .... partly because it is easier to use without "--".
#398404#132
Date:
2010-01-07 13:19:08 UTC
From:
To:
Hi,

This is my proposed changes:
http://git.debian.org/?p=pbuilder/pbuilder.git;a=shortlog;h=refs/heads/osamu

I hope this is now easier to review.

Minor correction on my previous mail.
-------x8 The work flow with the mode option, e.g. "mode1" goes as: $ sudo pbuilder --mode mode1 --create $ sudo pbuilder --mode mode1 --login --save-after-login ... interactive configuration of chroot ^D $ pdebuild --mode mode1 -------x8 Please note there is no "--" for pdebuild. This is how it needs to be used. (as documented in patched manpage) Osamu ------------------------------------------------------------------ PS: This can be fixed by changing inside pdebuild and others too. NOW in source as: ${PBUILDERROOTCMD} ${PDEBUILD_PBUILDER} --build ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" --d ebbuildopts "" --debbuildopts "${DEBBUILDOPTS}" "$@" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc REPLACE with: ${PBUILDERROOTCMD} ${PDEBUILD_PBUILDER} "$@" --build ${EXTRA_CONFIGFILE[@]/#/--configfile } --buildresult "${BUILDRESULT}" --debbuildopts "" --debbuildopts "${DEBBUILDOPTS}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc But I did not do this. .... partly because it is easier to use without "--".
#398404#141
Date:
2010-01-08 22:59:19 UTC
From:
To:
        Hey

 This is excellent!  It's exactly what I intended to work on next!  See
http://lists.alioth.debian.org/pipermail/pbuilder-maint/2009-December/003373.html
 and thread.

 I will review your code changes; however I do prefer the name "profile"
 over "mode".  The "mode" reminds me of the mode of operation such as
 "build" versus "create" versus "update" etc.  Do you think it would be
 ok to call this profile or something else?

   Thanks!

#398404#144
Date:
2010-01-08 22:59:19 UTC
From:
To:
        Hey

 This is excellent!  It's exactly what I intended to work on next!  See
http://lists.alioth.debian.org/pipermail/pbuilder-maint/2009-December/003373.html
 and thread.

 I will review your code changes; however I do prefer the name "profile"
 over "mode".  The "mode" reminds me of the mode of operation such as
 "build" versus "create" versus "update" etc.  Do you think it would be
 ok to call this profile or something else?

   Thanks!

#398404#149
Date:
2010-01-09 01:02:53 UTC
From:
To:
Hi,

Please remember not to release this kind of change without updating
cowdancer (junichi requested this.)

I see.

Switching environment via $BASE_DIR/$DISTRIBUTION-base.tgz only works
for tar.gz.  --no-targz and uml-environment requires different codes and
get complicated.  Adding extra path just under /var/cache/pbuilder/ is
cleaner.  You can remove all related files with:
 $ sudo rm -rf /var/cache/pbuilder/<pbprofile>

(FYI: my old patch is at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398404 )

Back then, I had a bit more complicated patch which also changes
behavior of setting /etc/apt contents in June 2008.  I think those part
related to /etc/apt contents is interesting but add too much complexity
to pbuilder and I decided to drop them now.

(Since my old changes were too much and harder to review, junichi asked
to make a branch which can be reviewed and here am I with write access
to git. I have been slow since I wanted to rethink what is important to
add as new feature.)

This patch is simplified one.

FYI: I just picked mode as the shortest word from candidates:
 mode environment switch buildmode

This is somewhat tested with pbuilder/pdebuild with targz and no-targz.
But uml side is not tested at all since I do not use it.

TODO list:

* create patch for cowdancer (help needed) !!! IMPORTANT !!!
* code/manpage review        (help needed)
* update both pbuilder and cowdancer
* Update documentation       (after discussion)
  * deprecating user for mangling configuration variable containing
    /var/cache/pbuilder directly.  Less error prone.
  * For shared aptcache, recommend to create symlink in directory than
    playing with config file.  Less error prone.
  * 4.8 "Using environmental variables ..." may be substituted.

Comment:

I thought about switching configuration files with mode/profile too.
For the sake of simplicity, I did not.  You can still select them like

$ pbuilder --profile myprofile --create --configfile myconfig

Osamu