[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#225947: apt-utils: please support architecture-specific extra overrides



On Sat, Jan 03, 2004 at 07:46:00PM -0800, Matt Zimmerman wrote:
> +   inline Item *GetItem(string Package,string Architecture) 
>     {
>        map<string,Item>::iterator I = Mapping.find(Package);
>        if (I == Mapping.end())
> +      {
> +         I = Mapping.find(Package + "/" + Architecture);
> +         if (I == Mapping.end())
> +         {
> +            return 0;
> +         }
> +      }
>        return &I->second;
>     };

Hrm, I'm pretty sure this can't work: Mapping.find("foo") will always be
successful as long as "foo" has an ordinary override (ie, the traditional
priority/section override) -- which it always will in Debian.

Swapping them around (so the Pkg/Arch test is first, followed by the Pkg
test only if that fails), should thus make the arch-specific overrides
work, at the cost of losing the original overrides for those packages.

My tests seem to bear this out.

So, that probably means:

> [...] one thing which will _not_ work is:
> 
> abiword         Task            desktop
> abiword/i386    SomeOtherField  value
> 
> (since it only uses the first match).  This could be changed if necessary.

needs to be changed. :-/

The easiest way I can see of doing it is having a second parse over
the overrides once they've been collated to add all the "foo" overrides
to all of the "foo/bar" overrides. Ugly though.

> -   Override::Item *OverItem = Over.GetItem(Package);
> +   Override::Item *OverItem = Over.GetItem(Package,Architecture);

The other problem with this is that it uses the .deb arch, not the
Packages file arch -- so you get "all" instead of "i386", eg. Can probably
ignore that, but it'd be good to avoid.

Cheers,
aj

-- 
Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/>
Don't assume I speak for anyone but myself. GPG signed mail preferred.

Protect Open Source in Australia from over-reaching changes to IP law
http://www.petitiononline.com/auftaip/ & http://www.linux.org.au/fta/

Attachment: signature.asc
Description: Digital signature


Reply to: