[pbuilder-dist] overwrite OTHERMIRROR set in ~/.pbuilderrc

Bug #1004579 reported by Aurélien Leblond
72
This bug affects 13 people
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Hello,

I was going to open a bug, but I just want to be sure that I'm not doing anything stupid first :)

My ~/.pbuilderrc looks like this:
     OTHERMIRROR="deb file:///home/blablack/pbuilder/precise_result ./"
     BINDMOUNTS="/home/blablack/pbuilder/precise_result"
     HOOKDIR="/home/blablack/pbuilder/hooks"
     EXTRAPACKAGES="apt-utils"
     ALLOWUNTRUSTED=yes

In Oneiric, this exact configuration was working ok (I have the hook file as well).

Since Precise, it doesn't seem to take the OtherMirror into consideration.

I ran pbuilder-dist with --debug-echo and it looks like this:
['sudo', 'HOME=/home/blablack', 'ARCHITECTURE=amd64', 'DISTRIBUTION=precise', 'ARCH=amd64', 'DIST=precise', 'DEB_BUILD_OPTIONS=', 'pbuilder', '--build', '--distribution', 'precise', '--buildresult', '/home/blablack/pbuilder/precise_result/', '--basetgz', '/home/blablack/pbuilder/precise-base.tgz', '--logfile', '/home/blablack/pbuilder/precise_result/last_operation.log', '--mirror', 'http://archive.ubuntu.com/ubuntu', '--othermirror', 'deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse|deb http://archive.ubuntu.com/ubuntu precise-proposed main restricted universe multiverse', '--components', 'main restricted universe multiverse', 'suil_0.6.1~svn4338~ppa1.dsc']

Let me know if there is any other information I could provide that would be valuable,

Aurélien

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pbuilder (Ubuntu):
status: New → Confirmed
Revision history for this message
Jason Conti (jconti) wrote :

This works correctly in pbuilder in precise, it is just that the --othermirror option overrides ~/.pbuilderrc, and it seems this option was added by default since commit 1208 in lp:ubuntu-dev-tools (or somewhere around there).

I'm going to move this to ubuntu-dev-tools since that package has pbuilder-dist.

affects: pbuilder (Ubuntu) → ubuntu-dev-tools (Ubuntu)
Revision history for this message
Stefano Rivera (stefanor) wrote :

pbuilder-dist will respect an OTHERMIRROR variable from the environment, if you need to add a mirror. It sounds like you are working around LP: #371221, so we should rather just fix that.

Changed in ubuntu-dev-tools (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Aurélien Leblond (blablack) wrote :

Hello Stefano,

The bug status has been changed from Confirmed to Incomplete.

Is there any information you would like me to provide?

Aurélien

Revision history for this message
Stefano Rivera (stefanor) wrote :

Oh, sorry, wrong bug. I thought it was another one about othermirror, where the proposed patch didn't do anything useful.

Changed in ubuntu-dev-tools (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Stefano Rivera (stefanor) wrote :

This one is mostly by design. I don't see any straightforward solution for it.

Benjamin Drung (bdrung)
summary: - pbuilder-dist overwrite OTHERMIRROR set in ~/.pbuilderrc
+ [pbuilder-dist] overwrite OTHERMIRROR set in ~/.pbuilderrc
Changed in ubuntu-dev-tools (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Oliver Sauder (sao) wrote :

I guess another possibility would be to read pbuilderrc as well within pbuilder-dist? So if the environment var is not set, check whether it is set in pbuilderrc before then reading devscripts fallbacks.

Revision history for this message
Dan Streetman (ddstreet) wrote :

please reopen if this problem still exists

Changed in ubuntu-dev-tools (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Andrew Bate (andrewdbate) wrote (last edit ):

This bug still exists in focal 20.04. It should not have been closed.

When using pbuilder-dist the value of OTHERMIRROR is ignored, as is the value of --othermirror passed as argument to pbuilder-dist.

To work around this I need to manually add a mirror to /etc/apt/sources.list from within a hook file, which is a bit of a hack and shouldn't be necessary.

Revision history for this message
Andrew Bate (andrewdbate) wrote (last edit ):

Adding to my previous comment, I can also see that the documentation is wrong.

The page https://wiki.ubuntu.com/PbuilderHowto#Differences_with_pbuilder says that:

[QUOTE]
pbuilder-dist does apparently not yet support all kinds of operations. The following doesn't work correctly for example:

sudo pbuilder-dist eoan i386 update --override-config --othermirror "deb http://ppa.launchpad.net/cae-team/ppa/ubuntu eoan main"

So if you want to add a repository, you will have to use "OTHERMIRROR" in ~/.pbuilderrc as follows:

OTHERMIRROR="deb http://ppa.launchpad.net/cae-team/ppa/ubuntu eoan main"
[/QUOTE]

But adding OTHERMIRROR to ~/.pbuilderrc has no effect, as was originally reported.

Basic tracing shows that this is still the case in focal (20.04).

My workaround has been to add a hook directory ~/.pbuilderrc by adding the line:
HOOKDIR="$HOME/.pbuilder-hooks/"

Then in $HOME/.pbuilder-hooks/ create a file D10addsource which contains the lines:
echo "deb [your-source-here]" >> /etc/apt/sources.list
apt-get update

However, if setting OTHERMIRROR inside of ~/.pbuilderrc worked as documented, then all I would have needed to do would be to add the following line to ~/.pbuilderrc and no hook required:
OTHERMIRROR="deb [your-source-here]"

If my workaround is wrong, please tell me.

So in summary, this bug still exists. If the bug is not going to be fixed, then at least the documentation needs to be updated.

This bug is somewhat related to https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools/+bug/371221, because if packages from ~/pbuilder/dist_result could satisfy dependencies then I wouldn't need to use OTHERMIRROR. But really OTHERMIRROR should still work regardless.

Mattia Rizzolo (mapreri)
Changed in ubuntu-dev-tools (Ubuntu):
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.