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

Bug#216682: apt/preferences: need for pinning a given (set of) package per release

On Mon, Oct 20, 2003 at 12:12:15AM +0200, Yann Dirson wrote:

> - there is a specific form (identified by a single package name) and a
> general one (identified by "Package: *")
>  - the general one allows to assign a priority to the version of all
>  packages provided by a given (set of) repository(ies) (ie. a line from
>  sources.list), regardless of what this version is.  The computed
>  priority can then be observed in "apt-cache policy" output on the
>  left of the relevant repository line.
>  - the specific one allows to assign a priority to a given (range of)
>  version(s) of a given package, based on various criteria (see below).
>  The computed priority can then be observed in "apt-cache policy"
>  output on the right of the matched package version, even when not
>  using the package version as criteria.  Additionally, a possible
>  display bug in "apt-cache policy" causes the elected priority to get
>  displayed next to all other available versions.

I don't think I like this "general" vs. "specific" distinction.  I'd rather
say something like:

  Each stanza contains criteria used to match a set of packages and
  versions, and preferences that should be applied to those packages.

  Packages can be matched by name, or "*" can be used to match all packages.

  Versions can be matched [describe the methods]...

  The preferences which can be applied are [pins]...

Does that make sense?

> - for a given package, only the last paragraph of the specific form is
> read, all previous ones are ignored without notice.  Because of this
> the layout of "apt-cache policy" output seems strange, and this could
> account for the above-mentionned "possible display-bug".

Is this true?  I haven't checked the code.  It seems more likely that it
simply overwrites existing data in those fields.

> - FIXME: I did not experiment yet with equivalent combinations of the
> general forms

What do you mean?

> - FIXME: given independant scores for the general and specific forms, I
> suppose the candidate version is the one which has the best eligible score
> in either slot ?

I'd have to look over the code to find out which match wins, if there is a
general rule.  The old man page said this:

       Each  package may be pinned to a specific version and each Pack-
       ages file has a priority for every package inside.  The  highest
       priority assigned to a package is the one that is used.

> - There are 3 ways of selecting (pinning) the (range of) versions a
> paragraph refers to: by release, by version, and by origin.  A
> paragraph of the general form can only use a "release" Pin, whereas a
> paragraph of the specific form can use any Pin form.

Pins for a specific package can use version, release or origin.  Wildcard pins
("general form") can use release or origin (obviously an individual package
version doesn't make sense).

 - mdz

Reply to: