[Pbuilder-maint] A sane guess at default Debian mirror for pbuilder

Lars Wirzenius liw at liw.iki.fi
Sun May 27 16:22:26 UTC 2007


On ma, 2007-05-28 at 00:25 +0900, Junichi Uekawa wrote:
> piuparts:
> 	Looks at first 'deb' line from /etc/apt/sources.list
> 		-> Can't handle /etc/apt/sources.list.d 
> 		-> Assumes that the top entry is the best

I didn't want to have piuparts use all sources.list entires, since they
often have things like debian-multimedia in them. Since apt favors the
first one if it can, picking just the first one seemed like a reasonable
thing to do, as a guess. If the guess turns out to be wrong, then it's
easy enough to override, but it seems to work often enough that it is
helpful to guess.

> emdebian-tools:
> 	Using 'apt-cache policy' to obtain information
> 		-> told on IRC that it loses port number info.
> 		-> probably picks up security mirrors too, which 
> 			can't really be used for running debootstrap.

I should have to dig up documentation, but I can't see that apt-cache
policy outputs enough info to re-create the sources.list lines. For
example:

 500 http://agnes lenny/main Packages
     release o=Unofficial Multimedia Packages,a=testing,l=Unofficial Multimedia Packages,c=main
     origin agnes
 500 http://agnes lenny/main Packages
     release o=Debian,a=testing,l=Debian,c=main
     origin agnes

Those two stanzas correspond to two different sources.list lines. I
don't see enough information there to re-create them:

deb http://agnes/debian lenny main contrib non-free
deb http://agnes/debian-multimedia/ lenny main

) could be wrong, of course: there are many details of apt I do not
know.

> debootstrap:
> 	uses ftp.debian.org as default mirror.

If ftp.debian.org doesn't contain all architectures, then that's a bad
default, imho.

> Probably difficult parts:
> 	handling CD-ROM installation

I don't think running pbuilder against CD-ROMs is a workable solution in
the modern world. There's way too many CDs involved. Anyone who really
wants to do that can be expected to go through the small amount of pain
of configuring pbuilder manually.

> 	mixed stable-backports / security / s-p-u / ubuntu / whatever installation.

The host system should, of course, be able to run such a mix freely. The
environment built by pbuilder, piuparts, or other tools, should not,
unless explicitly configured to do so, because the risk of contaminating
uploads to Debian is too great.

> I'm inclined to add a default configuration which uses the first
> usable line starting with 'deb http://' from /etc/apt/sources.list,
> and maybe check with a debconf question.

I don't think using debconf is a good idea. Any answer you get is valid
when the package is installed, but won't be valid later. The answer
should be generated dynamically, each time pbuilder (or piuparts or
whatever) needs it.

I propose that it be encoded into a new command,
apt-default-sources.list or something like that, which, when run,
outputs a sources.list that tools like pbuilder and piuparts can use.
Put the heuristics into that command, and then it doesn't need to be
duplicated in every package that needs it.

-- 
The most difficult thing in programming is to be simple and
straightforward.




More information about the Pbuilder-maint mailing list