pbuilder-apt-config

Loïc Minier lool at dooz.org
Sun Jan 31 13:59:52 UTC 2010


On Sun, Jan 31, 2010, Osamu Aoki wrote:
> 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" ; }|
[...]
> where default_mirror_map=/usr/share/pbuilder/mirror_map .
> This way, you can present a good example for $mirror_map file.

 That would work, it just eased development to have a fully working
 script with builtin defaults and I admit I like the fact I can easily
 transport the script anywhere, and it will be useful.  Also, I like the
 fact that the definition of what "debian" or "debian-archive" are is
 written in the same place are where these are used.  I could however
 change the script to dump its default mirror-map as to allow generating
 the default file during the pbuilder build.

 I agree it would be more consistent with other things in pbuilder, but
 I admit I would like to keep this little helper more standalone than it
 should be.   ;-)

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

 I agree too many methods would be a bit confusing; would I implement
 this, I wouldn't use bash arrays but just create an in-memory
 mirror-map:
    memory_map=""
    case $mirror in
      *" "*)
        memory_map="$memory_map
$2"
      ;;
      *)
        mirror="$2"
      ;;
    esac

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

 I'm not sure I follow you here; would you mind expanding?

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

 This is the case, but only in "--suite" mode; it's not possible to use
 it in --profile mode because --profile might generate sources using
 multiple archives (e.g. backports.org + debian).  So if you try calling
 pbuilder --mirror something --distribution lenny-backports, I can't do
 anything out of --mirror.
   In theory, I could use --mirror if --profile expands to a single
 archive, but that has good chances of messing up the code -- unless I
 refactor the script to post-process the output and check whether the
 archive is always the same, hmm...

-- 
Loïc Minier



More information about the Pbuilder-maint mailing list