--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: apt: bugs/deficiencies in apt_preferences evaluation
- From: Christoph Anton Mitterer <calestyo@scientia.net>
- Date: Tue, 27 Jan 2015 03:00:15 +0100
- Message-id: <20150127020015.25990.54814.reportbug@heisenberg.scientia.net>
Source: apt
Version: 1.0.9.6
Severity: normal
Hi.
I recently noted a "bug" in my own apt_preference configuration... what I
do is roughly the following:
I have a Debian installed as e.g. stable, but wish to take certain packages
from other suites, so I enable these suites in sources.list, e.g.
deb http://debian.mirror.lrz.de/debian/ stable main contrib non-free
deb http://debian.mirror.lrz.de/debian/ stable-updates main contrib non-free
deb http://debian.mirror.lrz.de/debian/ testing main contrib non-free
deb http://debian.mirror.lrz.de/debian/ testing-updates main contrib non-free
deb http://debian.mirror.lrz.de/debian/ testing-proposed-updates main contrib non-free
deb http://debian.mirror.lrz.de/debian/ unstable main contrib non-free
"disable" all packages from the non-stable suites via apt_preferences, e.g.
via something like:
Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 1
and selectively enable those packages from other suites I want, e.g. via:
Package: foobar
Pin: release o=Debian,a=testing
Pin-Priority: 500
Worked fine, till I've noted yesterday, that sudo was going to be upgraded,
which I haven't pinned. So I looked it up and found that testing-updates and
testing-proposed-updates use their own names as Suite: ... okay, my bad, I
needed to add disabling rules for these as well, e.g.
Package: *
Pin: release o=Debian,a=testing-updates
Pin-Priority: 1
and so on.
Then I noticed that my pinning of single packages would of course suffer from
the same problem, i.e. when I pin a=testing, and a newer version is in a=testing-*
it wouldn't be taken.
The same when I want to do something like "take package foo from testing|unstable,
whichever is newer" (of course this doesn't make that much sense given how
testing/unstable works, at least in Debian).
So I tried for sudo something like:
Package: sudo
Pin: release o=Debian,a=testing,a=testing-updates,a=unstable
Pin-Priority: 1
which seemed to work at first, but then I've noted that apparently apt takes simply
only the last a=... IOW, multiple a=,a=,... is not like OR (which should be documented
btw.)
Simply revert the order, e.g. a=unstable,a=testing,... and you'll see that it will NOT
take the highest version from all ORed suites.
Next, and this is where IMHO the actual bug/deficiencie lies, I tried:
Package: sudo
Pin: release o=Debian,a=testing
Pin-Priority: 1
Package: sudo
Pin: release o=Debian,a=unstable
Pin-Priority: 1
which showed, that this seems to work like a stop-after-first-match.
IOW, it does the testing match, but doesn't pin unstable.
If one disables testing from sources.list, it would even not find a pin
at all (apt-cache policy telling: "Package pin: (not found)").
So in the end, the whole idea of selectively pinning a package for one specific
suite works only for ONE suite.
Which is apparently quite bad, given that testing/testing-updates/testing-proposed-updates
are handled as different suites.
The same when you add Debian Backports to the game...
Cheers,
Chris.
--- End Message ---
--- Begin Message ---
- To: Christoph Anton Mitterer <calestyo@scientia.net>, 776341-done@bugs.debian.org
- Subject: Re: Bug#776341: apt: bugs/deficiencies in apt_preferences evaluation
- From: Julian Andres Klode <jak@debian.org>
- Date: Fri, 14 Aug 2015 15:44:58 +0200
- Message-id: <20150814154429.GA32321@debian.org>
- In-reply-to: <1422325717.14326.5.camel@scientia.net>
- References: <20150127020015.25990.54814.reportbug@heisenberg.scientia.net> <handler.776341.B.142232402011836.ack@bugs.debian.org> <1422325717.14326.5.camel@scientia.net>
On Tue, Jan 27, 2015 at 03:28:37AM +0100, Christoph Anton Mitterer wrote:
> Hi.
>
> I just saw that there is a POSIX ERE matching mode, which can be used to
> solve the above issue (the glob matching, which I knew of, alone
> wouldn't have so).
>
> So I guess you can close this bug, but I leave it open for now, that you
> can double check, whether the observed behaviour is actually desired.
>
> Also, I add a note to #776337, that the manpage should be improved to
> tell that multiple a=,a= and similar are not supported.
> Apart form that, one would perhaps welcome more examples about how to
> use the EREs,... e.g. describing which of the following it is:
> Pin: release /a=testing(|-updates)/
> Pin: release a=/testing(|-updates)/
>
> And since those apparently als match e.g. FOOtesting:
> Pin: release /^a=testing(|-updates)$/
> Pin: release a=/^testing(|-updates)$/
Yep, closing. The behavior is intended.
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Be friendly, do not top-post, and follow RFC 1855 "Netiquette".
- If you don't I might ignore you.
--- End Message ---