On Tue, Sep 11, 2012 at 04:13:15PM +0800, Daniel Hartwig wrote: > Package: apt > Version: 0.9.7.4 > Severity: normal > Tags: patch > > Moving the discussion about pinning by architecture to a new report. > Original context is <http://bugs.debian.org/670322> > > On 11 September 2012 09:18, Daniel Hartwig <mand...@gmail.com> wrote: > >> Arch-qualification will work for specific-packages stanzas only, > > > > A bit of a hack but it worked when I tested it. apt-cache policy > > listed every armel package as pinned, which is not very nice output > > ;-) > > Looks like I misread and thought you were saying that doesn't work. > Sorry for that :-) > > > > >> but you can do this: > >> Package: * > >> Pin: release n=squeeze,b=armel > >> Pin-Priority: 991 > > > > A better format, though it is not documented or working (?) in 0.9.7.4: > > I see where the support for this is in versionmatch.cc and the above > seems to not work because PackageFile::Architecture is never > populated. Actually, python-apt docs say this is normal: > > > class apt_pkg.PackageFile > > … > > architecture > > The architecture of the package file. This attribute normally > > contains an empty string and is thus not very useful. > > Is there a reason for that (maybe to do with arch: all)? Looks like > it could be done in debListParser::LoadReleaseInfo (or > debPackagesIndex::Merge).
You can only have those for Debian-style repositories with dists/, you can not have this for flat repositories. > > I have attached a first attempt at a patch, which partially works > (obviously needs more testing). > > Note that the candidate for aptitude /seems/ wrong, but technically > the first stanza (“Package: *”) does not apply since the second is > more specific. Changing the second to “Package: aptitude:amd64” gives > better output but defeats the purpose of using “b=amd64”, at least on > specific-package stanzas. It does not work, probably because APT tries to pin aptitude:i386 to a version with architecture: amd64, which does not exist. I'd go with EXPRESSION:ARCHITECTURE pinning, like aptitude:amd64 or *:amd64, or /regex/:amd64. But we don't appear to have implemented *:amd64 correctly yet (with the same semantics as *, it is not considered more generic than name:amd64). I don't know whether this is possible though. -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org