pbuilder-dist tries Ubuntu components for Debian distro

Bug #140964 reported by Scott Kitterman
12
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Fix Released
Medium
Laurent Bigonville

Bug Description

Binary package hint: ubuntu-dev-tools

pbuilder-dist does not currently specify ''--mirror" and so defaults to Ubuntu even if the distribution specified is Debian.

update: it does not specify which components to use, and we can't do that via the command line yet.

Revision history for this message
Laurent Bigonville (bigon) wrote :

Seems fixed in 0.11

Changed in ubuntu-dev-tools:
status: New → Fix Released
Revision history for this message
Laurent Bigonville (bigon) wrote :

Reopening as in fact it doesn't work

Changed in ubuntu-dev-tools:
status: Fix Released → Confirmed
Revision history for this message
Siegfried Gevatter (rainct) wrote :

I think I fixed this issue, it probably doesn't work because of bug #146475.

Changed in ubuntu-dev-tools:
importance: Undecided → Medium
Revision history for this message
Adrien Cunin (adri2000) wrote :

It doesn't work even with bug #146475 fixed.

Revision history for this message
Adrien Cunin (adri2000) wrote :

The problem seems to be that pbuilder finds out which components to use from the $COMPONENTS var defined in pbuilderrc.
Therefore, if pbuilderrc contains restricted|universe|multiverse, the Debian pbuilder creation will fail.
I don't see any good fix for this, as there is no way to specify which components to use via the command line. This is a bug, reported as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422371

So, the workaround for now is to set $COMPONENTS to main only in pbuilderrc.

description: updated
Changed in ubuntu-dev-tools:
assignee: nobody → adri2000
Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 140964] Re: pbuilder-dist tries Ubuntu mirror for Debian distro

I don't think that's right as the user I found the problem on doesn't have any
pbuilder config file. I worked around it by adding (IIR) --mirror to the
pbuilder call (which then borks Ubuntu pbuilders so it's not a general
solution).

Revision history for this message
Adrien Cunin (adri2000) wrote :

If ~/.pbuilderrc doesn't exist, /etc/pbuilderrc is used.
And, I don't know which version of ubuntu-dev-tools it was, but in the current one pbuilder-dist does call pbuilder with --mirror.

Revision history for this message
Adrien Cunin (adri2000) wrote :

Thanks for the patch Laurent, I would have done it otherwise but well :)
I'll commit it once the new pbuilder (which includes my patch for --components) is merged and uploaded.

Changed in ubuntu-dev-tools:
status: Confirmed → In Progress
Revision history for this message
Laurent Bigonville (bigon) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 140964] Re: pbuilder-dist tries Ubuntu components for Debian distro

On Monday 22 October 2007 17:22, Laurent Bigonville wrote:
> For record http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422371

I don't see how that's relevant. There's no way this was tested against a
Debian release before it was uploaded. Maybe it's just me, but testing is
generally a good thing to do. Ugh.

I'd have uploaded my fix, but I saw it's in bzr and didn't want to get things
out of sync.

Revision history for this message
Laurent Bigonville (bigon) wrote :

The patch has been tested with the git version of pbuilder

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 140964] Re: pbuilder-dist tries Ubuntu components for Debian distro

Please don't make a solution that requires a pbuilder backport to work.

Revision history for this message
Adrien Cunin (adri2000) wrote :

We are not talking about backport.
There is a new option (--components) currently available in pbuilder git (the patch for it just got accepted).
Laurent's patch use this new --components option of pbuilder, so it will be committed and uploaded once we have the new pbuilder.
What's the problem?

Bug assigned to Laurent, as he is now officially a MOTU, he can commit to trunk without me :)

Changed in ubuntu-dev-tools:
assignee: adri2000 → bigon
Revision history for this message
Siegfried Gevatter (rainct) wrote : Re: [Bug 140964] Re: pbuilder-dist tries Ubuntu components for Debian distro

2007/10/23, Adrien Cunin <email address hidden>:
> We are not talking about backport.
> There is a new option (--components) currently available in pbuilder git (the patch for it just got accepted).

Exactly, so this will need to get into Hardy with a backport.

Revision history for this message
Scott Kitterman (kitterman) wrote :

On Tuesday 23 October 2007 13:00, Siegfried Gevatter (RainCT) wrote:
> 2007/10/23, Adrien Cunin <email address hidden>:
> > We are not talking about backport.
> > There is a new option (--components) currently available in pbuilder git
> > (the patch for it just got accepted).
>
> Exactly, so this will need to get into Hardy with a backport.

Which is, IMO, a really bad idea. In the near-term most everyone using this
script will do it on Gutsy. Please make it work with the Gutsy pbuilder.
It's pretty trivial to do so.

Revision history for this message
Adrien Cunin (adri2000) wrote :

So you want to backport ubuntu-dev-tools to gutsy (and don't want to have to backport pbuilder as well) ?
Would have been a good idea to start with that.

Well, then please tell me what the "pretty trivial" fix is.

Revision history for this message
Scott Kitterman (kitterman) wrote :

On Tuesday 23 October 2007 14:12, Adrien Cunin wrote:
> So you want to backport ubuntu-dev-tools to gutsy (and don't want to have
> to backport pbuilder as well) ? Would have been a good idea to start with
> that.

I think most peopel will just get the source package and use the scripts
without formal backporting.

> Well, then please tell me what the "pretty trivial" fix is.

It's been a while since I looked, but what I was going to do before I noticed
the bzr repo, gave up, and just hacked out my own for local use was to
reorganize the code so that in the bit where it decides if it's an Ubuntu or
Debian distro construct the entire command line there one with
(IIRC) --mirror and the other without.

Revision history for this message
Siegfried Gevatter (rainct) wrote :

There is already a --mirror call in the latest version iirc.

Revision history for this message
Scott Kitterman (kitterman) wrote :

On Wednesday 24 October 2007 03:49, Siegfried Gevatter (RainCT) wrote:
> There is already a --mirror call in the latest version iirc.

I haven't tried the latest version since my hacked version is working fine for
me (it's nothing I'd ever upload), but IIRC Debian needed mirror and wouldn't
work with othermirror and Ubuntu was the reverse, but it's been a while since
I looked at it.

My main thing is that it shouldn't require a new pbuilder to work. Most devs
will just grab the most recent source and use it, so it should work on any
Ubuntu release (Debian too for that matter).

Revision history for this message
Adrien Cunin (adri2000) wrote :

I'll try to sum things up:

Currently pbuilder-dist calls pbuilder with --mirror $archive and --othermirror $mirror $components
with $archive being archive.u.c or ftp.d.o, and $components being main restricted (universe multiverse) or main (contrib non-free).
As you can see, we don't specify the components for the mirror specified in --mirror. pbuilder uses for that the $COMPONENTS var defined in pbuilderrc.
If this var contains restricted|universe|multiverse, pbuilder-dist will fail with Debian. So the workaround is to put only main in that var and let --othermirror manage the components. That is not the best solution because it's not very clean, and you will get a "duplicate mirror" warning for the main component.

Now the real solution. It's to not use --othermirror (we only want to use one mirror), but only --mirror. But we need to be able to specify the components for that mirror. And here comes the pbuilder patch which adds the --components option. pbuilder-dist will call pbuilder with --mirror $archive and --components $components.

I don't see any other solution to cleanly fix this bug, and IMO "that won't be backportable" is not a good reason for not fixing a bug.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Oddly enough, laserjock's original script that this started from worked just
fine with Debian and Ubuntu both.

I don't understand how a pbuilder upgrade is needed to fix a regression in the
script.

Revision history for this message
Adrien Cunin (adri2000) wrote :

I found a version in the bzr revisions history that uses only --othermirror. But did that work? I'm doubtful because $MIRRORSITE (which is the var set when using --mirror) is defined in pbuilderrc. That probably caused problem when creating a Debian chroot while $MIRRORSITE was set to Ubuntu archive, and vice versa. Maybe the person (RainCT?) who added --mirror could explain why? was it for that reason?

Maybe that version of pbuilder-dist worked with Debian and Ubuntu, but only if you removed $MIRRORSITE from pbuilderrc.
Otherwise I'm not sure pbuilder-dist has ever really worked with both Debian and Ubuntu.

Revision history for this message
Adrien Cunin (adri2000) wrote :

Btw, as I think about it.
Laurent, you should keep --othermirror in the pbuilder call. --othermirror "".
If you don't do that and if $OTHERMIRROR is defined in pbuilderrc, the chroot will contain other repositories than the official ones. pbuilder-dist is supposed to create clean standard Debian and Ubuntu chroots.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Right. I'm not referring to the packaged one, but the one that used to live
in laserjock's directory on revu.tauware.de. You won't find it in bzr as it
was the original source that was improved and then added to the package.

Revision history for this message
Laurent Bigonville (bigon) wrote :

right I will add this to my branch (if I understand why double-quotes doesn't work grr)

Revision history for this message
Laurent Bigonville (bigon) wrote :

pbiulder 0.174 in debian's incoming

Revision history for this message
Scott Kitterman (kitterman) wrote :

On Thursday 25 October 2007 08:22, Laurent Bigonville wrote:
> pbiulder 0.174 in debian's incoming

I'm really still hoping it'll turn out to be irrelevant.

Revision history for this message
Adrien Cunin (adri2000) wrote :

Subscribed LaserJock.

Jordan: if your script used to work with both Debian and Ubuntu, can you tell us how to fix that bug now, without using the pbuilder --components option?

Revision history for this message
LaserJock (laserjock) wrote :

Well, the short answer is my script was really basic and I had separate ones for Debian and Ubuntu. For Debian I used:
      --mirror http://ftp.debian.org/debian/
and for Ubuntu I didn't set --mirror because since Dapper pbuilder in Ubuntu defaults to archive.ubuntu.com in --mirror and used:
      --othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse"
to get Universe and Multiverse enabled.

I'm not sure if that answers anything, but it worked fine for me creating both Debian and Ubuntu pbuilders.

Revision history for this message
Adrien Cunin (adri2000) wrote :

But that doesn't work if $MIRRORSITE and $OTHERMIRROR in pbuilderrc are not the default values (archive.u.c and nothing).

Revision history for this message
Scott Kitterman (kitterman) wrote :

On Friday 26 October 2007 11:50, Adrien Cunin wrote:
> But that doesn't work if $MIRRORSITE and $OTHERMIRROR in pbuilderrc are
> not the default values (archive.u.c and nothing).

I'd say working with the defaults would be an improvment.

Revision history for this message
Adrien Cunin (adri2000) wrote :

But working with whatever is set in pbuilderrc is even better, isn't it?
Configuration files are meant to be edited, and that shouldn't make any program not work anymore.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Agreed, but not working with modified configs is a step up from not working at
all.

Revision history for this message
Adrien Cunin (adri2000) wrote :

It *does* currently work (there may be a *warning*, but it works), if $COMPONENTS is set to "main" only in pbuilderrc.

Changed in ubuntu-dev-tools:
status: In Progress → Fix Committed
Revision history for this message
Siegfried Gevatter (rainct) wrote :

It *doesn't* work in gutsy, it throws an error about "--components" not being recognized and abort.

In revision 28 of my branch, between other changes, I fix this by checking the if the installed version of pbuilder is high enough, and if it isn't letting it use the old behavior plus, when it's working with Debian, display a warning telling that if there are problems it might be because of the $COMPONENTS variable in pbuilderrc.

Revision history for this message
Luke Yelavich (themuso) wrote :

ubuntu-dev-tools (0.21) hardy; urgency=low

  [ Laurent Bigonville ]
  * debian/control: add a space before the Homepage pseudo-field
  * pbuilder-dist: add hardy to the distribution list
  * pbuilder-dist: Use new --components options (LP: #140964)
  * pbuilder-dist: Add an empty --othermirror to override config in pbuilderrc

  [ Kees Cook ]
  * mk-sbuild-lv: fix gnupg install, adjust symlink creation

  [ Siegfried-Angel Gevatter Pujals (RainCT) ]
  * Add get-build-deps and it's documentation.
  * Change the character encoding on all Python scripts to UTF-8
  * submittodebian: better changelog location detection
  * submittodebian: user-friendly error if python-debian isn't installed
  * hugdaylist: improve error handling (less backtraces, more nice messages)
  * pbuilder-dist: look for global variable $PBUILDFOLDER (LP: #160769)
  * pbuilder-dist: check pbuilder version and only use --components if supported
  * pbuilder-dist: don't chown "unknown distribution" warning if an environment
    of that release already exists (LP: #160769)

  [ Luke Yelavich ]
  * debian/control:
    - Move homepage to its own field in source package section.

 -- Luke Yelavich <email address hidden> Thu, 08 Nov 2007 09:57:31 +1100

Changed in ubuntu-dev-tools:
status: Fix Committed → Fix Released
Revision history for this message
Adrien Cunin (adri2000) wrote :

> It *doesn't* work in gutsy, it throws an error about "--components" not being recognized and abort.

Yes, it doesn't work with gutsy because the fix was written for hardy. Btw, it's been published in hardy, and not in gutsy afaik. So why would/should it work in gutsy? Why are you publishing code in hardy that makes the existing code work in gutsy?

Revision history for this message
Laurent Bigonville (bigon) wrote :

This complicates the code a bit

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 140964] Re: pbuilder-dist tries Ubuntu components for Debian distro

Since it's premature to be running Hardy as your installed OS, it would
have been nice for someone to publish a fix that was actually immediately
useful.

Revision history for this message
Adrien Cunin (adri2000) wrote :

E: Type '' is not known on line 1 in source list /etc/apt/sources.list
on chroot creation.
Seems to be caused by --othermirror "". Anyone else experiencing this?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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