Smart locks are ignored by APT

Bug #509167 reported by Free Ekanayaka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Won't Fix
Medium
Unassigned

Bug Description

Okay, we knew this. But..

I've started playing with locks on my machine, with a real-life use case
for which I want to lock a few python libraries sporting binary modules
to the Karmic version, because support for Python 2.5 has been dropped
in Lucid.

So I've added the needed locks with "smart flag --set lock python-xy",
and everything works fine Landscape-wise.

However, I find it a bit annoying that "apt-get upgrade" ignores the
locks completely, offering me to upgrade those packages, and even a
simple "apt-get install" could break the locks if the packages going to
be installed require some later versions of the packages being locked.

I've thought that even though parsing the APT preferences file and
converting it to Smart locks is not easy, the other way round is not
that bad. Smart tells us which packages are locked, so we could generate
an APT preferences file which has an entry for every locked package,
setting its pinning priority to 1001 if the locked package is installed
(so that it won't be upgraded by default), and to -1 if the locked
package is not installed to -1 (so it won't be installed).

It's kind of brute force approach, but I guess it would work, and it
would make APT play nicer with Smart locks and hence with Landscape.

The generated APT preferences file would need to be re-generated every
time APT channels in the system's sources.list change, or new packages
pop up in the existing channels. For detecting if the sources.list is
changed, using inotify would be cool (and I guess there are another few
spots in the client where we could benefit from it).

 affects landscape-client
 importance medium
 milestone 1.4.4

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

So to make this look a bit more concrete, I'm pasting a sample of possible APT preferences file that would be generated by the client. It would be stored in something like /etc/apt/preferences.d/landscape-client

Let's say that we have created two package locks like "pulseaudio <= 0.9.21" and "python-pycurl" , that the pulseaudio package version 0.9.20-1 is installed and that version 0.9.23-1 is available, and that the python-curl package is not installed but version 7.19-1 is available in the APT channels defined by our sources.list.

The preferences file that the client would generate would be something like:

Package: pulseaudio
Pin: version 0.9.21-1
Pin-Priority: 1001

Package: pulseaudio
Pin: version 0.9.23-1
Pin-Priority: -1

Package: python-curl
Pin: version 7.19-1
Pin-Priority: -1

Changed in landscape-client:
milestone: 1.4.4 → 1.4.5
Changed in landscape-client:
milestone: 1.4.5 → 1.5.0
tags: added: testing
tags: removed: testing
tags: added: needs-testing
Changed in landscape-client:
milestone: 1.5.0 → 1.5.1
tags: removed: needs-testing
Changed in landscape-client:
milestone: 1.5.1 → 1.5.2
Changed in landscape-client:
milestone: 1.5.2 → 1.5.3
Changed in landscape-client:
milestone: 1.5.3 → 1.5.4
Changed in landscape-client:
milestone: 1.5.4 → 1.5.5
Changed in landscape-client:
milestone: 1.5.5 → 1.5.6
Changed in landscape-client:
milestone: 1.5.6 → later
Changed in landscape-client:
status: New → Won't Fix
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.