pbuilder-apt-config
Loïc Minier
lool at dooz.org
Sun Jan 31 09:32:06 UTC 2010
On Sun, Jan 31, 2010, Osamu Aoki wrote:
> I think one important factor is the separation of data from code.
Did you see the new --mirror-map flag? It allows point to a file which
has:
debian http://ftp.de.debian.org/debian/
ubuntu http://archive.ubuntu.com/ubuntu/
> I wonder why you did not start with the following (This patch is against
> sligtly old source but enough to identify what I am talking):
> -------------
> @@ -81,13 +81,13 @@ builtin_mirror_map() {
>
> case "$archive" in
> backports.org)
> - echo "http://www.backports.org/backports.org/"
> + echo "$mirror_backports"
> ;;
> debian)
These are the builtin defaults; they only get used if the archive isn't
found in the mirror map. ("builtin_mirror_map()")
I started with builtin URLs because that made testing + development
easier to start with, then looked for a form of override better than
--mirror, and this is how I came with --mirror-map. I can still add
other options to set mirror, for instance we could change --mirror to
handle archive + URL e.g.:
--mirror "backports http://www.backports.org/backports.org/"
> +mirror_backports="http://www.backports.org/backports.org/"
> +mirror_debian="http://ftp.us.debian.org/debian/"
> +mirror_debian_archive="http://archive.debian.org/debian/"
> +mirror_ppa="http://ppa.launchpad.net"
> +mirror_ubuntu="http://archive.ubuntu.com/ubuntu/"
> +mirror_ubuntu_ports="http://ports.ubuntu.com/ubuntu-ports/"
> +mirror_debian_security="http://security.debian.org/"
> +mirror_debian_volatile="http://volatile.debian.org/debian-volatile/"
Sure, that could work too, but that's *less* data driven IMO since you
have to encode each archive in a shell var. Currently, the only
archive specific shell vars are in the --profile code which is meant to
be archive-specific.
Also, I find it less convenient to pass a lot of --mirror-something
flags or to set a bunch of FOO_MIRROR= vars: mirrors typically don't
change for your various pbuilder environments. The Ubuntu archive is
always going to be at http://mirror/ubuntu/ for me, and at
http://archive.ubuntu.com/ubuntu/ for people who don't have a mirror;
even if I have 10 profiles using this archive (or not).
> -------------
> * overriding from coimmand line:
> we can have command line option to set each value if we wish.
Ack, I only offer --mirror-map; I felt that was the most natural for
data which doesn't change; my intent is to install a default map in
/etc/pbuilder/mirrors.pbuilderrc (or something like that) and have
pbuilder always pass it.
It's true that for the standalone tool, it's harder to override a
single archive mirror without creating a file. Would you find
--mirror="archive-name archive-url" sufficiently usable?
I could also make it --mirror-somarchive=url or
--somearchive-mirror=url, but that would probably mean moving away of
"getopt"; also, I would prefer avoiding the archive name in the flag
name because of archives such as ppa:someone or backports.org
(--mirror-backports.org=url or --ppa:someone-mirror=url is not very
elegant and is hard to parse right).
> * overriding via environment variable:
> use mirror_ubuntu_ports="${mirror_ubuntu_ports:+http://ports.ubuntu.com/ubuntu-ports/} instead.
For the same reason as for flags, it would be a bit hard to map these
to vars; e.g. to set the URL of the mirror of backports.org or
ppa:foobar. I could change the archive names, but I'm keen to keep a
mapping with archive names from the mirror lists.
> * override via configuration file:
> source something like /usr/share/pbuilder/archives and optionally
> /etc/pbuilder/archives to set these variables.
Yup; that's definitely supported
> > I'm currently thinking we should rip away the MIRROR debconf stuff
> > entirely and just default to autoguessing depending on the target of
> > the package and of the current distro.
>
> That is one way but I think we can keep it as long as we let it set
> something like $debian_mirror or $ubuntu_mirror using some guessing from
> URL.
Well I see debconf as a frontend to what's in /etc/pbuilderrc; if we
drop it, only new users should suffer from it, but old users will keep
MIRROR in their /etc/pbuilderrc. I have no idea what to map the
historic data to, except to pbuilder-apt-config --mirror (for --suite
mode).
We could write some Debconf frontend to set *any* mirror, but I think
that's quite hard.
--
Loïc Minier
More information about the Pbuilder-maint
mailing list