Cannot Pin on components

Bug #16240 reported by elwood
10
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

If I have an /etc/apt/preferences file with the following (which worked in warty
modulo s/hoary/warty/):

Package: *
Pin: release o=Ubuntu,a=hoary,l=Ubuntu,c=universe
Pin-Priority: -2

apt-cache policy returns:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.ubuntu.com hoary-security/restricted Packages
     release v=5.04,o=Ubuntu,a=hoary-security,l=Ubuntu
     origin security.ubuntu.com
 500 http://security.ubuntu.com hoary-security/main Packages
     release v=5.04,o=Ubuntu,a=hoary-security,l=Ubuntu
     origin security.ubuntu.com
 500 http://us.archive.ubuntu.com hoary-updates/restricted Packages
     release v=5.04,o=Ubuntu,a=hoary-updates,l=Ubuntu
     origin us.archive.ubuntu.com
 500 http://us.archive.ubuntu.com hoary-updates/main Packages
     release v=5.04,o=Ubuntu,a=hoary-updates,l=Ubuntu
     origin us.archive.ubuntu.com
 500 http://us.archive.ubuntu.com hoary/universe Packages
     release v=5.04,o=Ubuntu,a=hoary,l=Ubuntu
     origin us.archive.ubuntu.com
 500 http://us.archive.ubuntu.com hoary/restricted Packages
     release v=5.04,o=Ubuntu,a=hoary,l=Ubuntu
     origin us.archive.ubuntu.com
 500 http://us.archive.ubuntu.com hoary/main Packages
     release v=5.04,o=Ubuntu,a=hoary,l=Ubuntu
     origin us.archive.ubuntu.com
Pinned packages:

In warty it would have listed the component as c=universe, and pinned the
universe component properly. AFAICT the main difference (outside the code which
I haven't looked at yet) is that hoary does not download the component Release
files
(http://us.archive.ubuntu.com/ubuntu/dists/hoary/universe/binary-i386/Release.)
So perhaps it doesn't know how to correlate 'c=universe' in /etc/apt/preferences
with 'Components: main restricted universe multiverse' in
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_hoary_Release? Or perhaps
it is being too smart by not downloading the individual Release files which it
can parse?

Either way I am unable to Pin on a component.

Revision history for this message
Michael Vogt (mvo) wrote :

You analysis is correct, the fact that the individual Release files are no
longer used and only the global one is used caused this problem.

Revision history for this message
Michael Vogt (mvo) wrote :

I have a fix for that in my apt--mvo--0 branch at:
http://people.ubuntu.com/~mvo/arch/ubuntu

it will use the section-name as the component string. Do you see any possible
problems with that?

thanks,
 Michael

Revision history for this message
Adam Niedling (krychek) wrote :

No /etc/apt/preferences in Intrepid. I think it's called sources.list now but it looks different.

Changed in apt:
status: Confirmed → Invalid
Revision history for this message
elwood (nyogtha-gmail) wrote :

/etc/apt/preferences and /etc/apt/sources.list are not the same. /etc/apt/preferences doesn't exist by default, and by default it would be empty. You can create it and you can put the information above in it. I'll check at work this week to see if this bug still exists in Intrepid.

Michael I'm sorry, I never saw this update, or any update on this bug until just now. I guess launchpad wasn't sending email by default? I'd be happy to test your branch, but it's now old, and I'm not sure if it would be any use to test it?

Revision history for this message
Adam Niedling (krychek) wrote :

elwood: so please change the status of this bug to whatever you think is right.

Revision history for this message
Colin Watson (cjwatson) wrote :

Adam: Let's start by not closing the bug because you misunderstood the reporter, perhaps? Reverting to the previous state of Confirmed.

Changed in apt:
status: Invalid → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote :

This should be working since some time.

Package: *
Pin: release c=universe
Pin-Priority: 200

and apt-cache policy 2vcard give me the expected result

Changed in apt:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.