pbuilder-apt-config

Osamu Aoki osamu at debian.org
Sun Jan 31 13:12:30 UTC 2010


Hi,

On Sun, Jan 31, 2010 at 10:32:06AM +0100, Loïc Minier wrote:
> 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:

Excuse me.  My script suggestion was before fully reading your newer code (I
also had mental block with the initial cryptic sed script).
 
>     debian              http://ftp.de.debian.org/debian/
>     ubuntu              http://archive.ubuntu.com/ubuntu/

Although style of configuration file is completely different from the rest of
pbuilder, this itself is one solution provided this is used consistently within
code.
...
> > -        echo "http://www.backports.org/backports.org/"
> > +        echo "$mirror_backports"
> 
>  These are the builtin defaults; they only get used if the archive isn't
>  found in the mirror map.  ("builtin_mirror_map()")

Now I see it I understand why you did not do this in your logic style.  But why
did not you push the same "data driven method" to set the default values too.
Something like:

    { if [ -n "$mirror_map" ]; then cat "$mirror_map" ; fi ; cat "$default_mirror_map" ; }|
        while read a url; do
            case "$a" in
              "$archive")
                if [ -n "$url" ]; then
                    echo "$url"
                    return
                fi
              ;;
              \#*|""|*)
                :
              ;;
            esac
        done
     die "Unknown archive ..."

where default_mirror_map=/usr/share/pbuilder/mirror_map .

This way, you can present a good example for $mirror_map file.

>  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/"

I see.  This is OK but allowing multiple --mirror via bash array
variable is not so nice.  --mirror-map may be sufficient.  Too many methods
confuses people.

>  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.

I do not have strong opnion other than I want consistency between default and
user data.

>  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.

Why have default data in pbuilder when this default is for pbuilder-apt-config
with quite different script style and data format.  Please make this default
data parsed within pbuilder-apt-config.
 
>  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?

This is better than tha followings if you impliment it.

>    I could also make it --mirror-somarchive=url or
>  --somearchive-mirror=url, 
...
> > * 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.

This is not so important ... let's skip it.
 
> > * 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 now understand it.

> > >  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.

It looks to me if you have your kind of --mirror implimented and that override
all the mirror map, then not much change is needed for pbuilder to keep debconf
$MIRROR.

Osamu




More information about the Pbuilder-maint mailing list