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

Re: How to add dependencies that exist in another repository



On Thu, Nov 11, 2010 at 14:36, Andreas Tille <andreas@an3as.eu> wrote:
> to answer the previous question: Yes, I'm using Squeeze.
>
>> >From man apt_preferences:
>>   Note that the files in the /etc/apt/preferences.d directory are parsed
>>   in alphanumeric ascending order and need to obey the following naming
>>   convention: The files have no or "pref" as filename extension and which
>>   only contain alphanumeric, hyphen (-), underscore (_) and period (.)
>>   characters - otherwise they will be silently ignored.
>
> Well, this defines a *sequence* of these files but what about the
> *content*.  In /etc/apt/preferences the sequence of paragraphs
> does not matter.  Just the Pin-Priority value has relevance.  So

Wrong. The manpage says:
> If any specific-form records match an available package version then the
> first such record determines the priority of the package version.
> Failing that, if any general-form records match an available package version
> then the first such record determines the priority of the package version.

So its important in which sequence the paragraphs are written (and read).

The syntax of the fragment files is (obviously) the same as the one for
the main file, so i don't see what an example will help, but here we go:

/etc/apt/preferences:
Package: *
Pin: release experimental
Pin-Priority: -1

Package: *
Pin: release o=Debian
Pin-Priority: 400


/etc/apt/preferences.d/gcc-45.pref:
Package: gcc cpp-4.5 g++-4.5 gcc-4.5
Pin: release experimental
Pin-Priority: 500

$ apt-cache policy gcc
gcc:
  Installiert: 4:4.4.5-1
  Kandidat:    4:4.5.1-1exp1
  Paket-Pinning: 4:4.5.1-1exp1
  Versionstabelle:
     4:4.5.1-1exp1 500
         -1 http://ftp.de.debian.org/debian/ experimental/main i386 Packages
 *** 4:4.4.5-1 500
        400 http://ftp.de.debian.org/debian/ sid/main i386 Packages
        400 http://ftp.de.debian.org/debian/ testing/main i386 Packages
        100 /var/lib/dpkg/status
     4:4.3.2-2 500
        400 http://ftp.de.debian.org/debian/ lenny/main i386 Packages

In that example you can also see why the sequence is important - swap
the stanzas in the preferences file and all archives which match o=Debian
will be pinned to 400 - which includes experimental!

But if that doesn't work i guess a bug report is better suited
than proceeding in hijacking a thread…


Best regards

David Kalnischkies

P.S.: Yes, i know that the given gcc pinning is not enough,
my real stanza is longer - and the preferences file is a pure fiction…


Reply to: