Re: Questions about package pinning

Andre Costa <[email protected]> Fri, 30 Jul 2004 10:23:48 -0300
Newsgroups gmane.linux.conectiva.apt-rpm
Organization TecGraf
Message-ID <[email protected]>
Hi Panu,

On Fri, 30 Jul 2004 16:06:00 +0300
Panu Matilainen <[email protected]> wrote:

[...]
> > So, I put this on /etc/apt/preferences based on a couple of
> > references I found with Google:
> > 
> > Package: cdrecord
> > Pin: release c=freshrpms
> > Pin-Priority: 1001
> > 
> > And it seems to be working:
> > 
> > apt-cache policy cdrecord
> > cdrecord:
> >   Installed: 8:2.01-0.a19.2
> >   Candidate: (none)
> >   Package Pin: (not found)
> >   Version Table:
> >      8:2.01-0.fdr.5.a27.1 1001
> >         500 ftp://apt.kde-redhat.org fedora/1/stable pkglist
> >  *** 8:2.01-0.a19.2 1001
> >         500 http://ayo.freshrpms.net fedora/linux/1/i386/core
> >         pkglist 100 RPM Database
> > 
> > (although I didn't understand why the "(not found)" for "Package
> > Pin:"...)
> 
> That's because there's no version of cdrecord in "freshrpms"
> component. You'll want to use
> 
> Package: cdrecord
> Pin: release c=core
> Pin-Priority: 1001

Mmmh... ok, makes sense, and it did fix the "(not found)" issue. I
didn't go that way because it felt to me like there could be many "core"
components on different repos -- as well as "stable" (for kde-redhat
above). I guess I got it all wrong.

> > The thing is: I tried to use:
> > 
> > Package: cdrecord
> > Pin: release c=kde-redhat
> > Pin-Priority: 0
> > 
> > And it didn't work -- apt was trying to upgrade cdrecord to latest
> > from kde-redhat. My guess is that "c=kde-redhat" is wrong. Or should
> > I have used Pin-Prioiry = -1?
> 
> You'll want negative pin BUT negative per-package pins don't work
> quite as expected. It might work in the above case but at least if you
> try to prevent a specific version of a package from installing it
> doesn't work. I've a patch for the version-case at
> http://laiskiainen.org/apt/patches/

Cool. I hope it makes its way into mainstream apt. Still, in the case
above, why did priority = 0 not work? Or it would work _if_ I also had
the (fixed) entry for freshrpms above (which seems redundant to me)?

> > So, any good reference about apt pinning will be most welcome --
> > specifically, I'd like to know to specify a, c, o, l, v for a
> > specific package/repository?
> 
> "apt-cache policy" is the best way to see what the various parameters
> are for a given repository. In many cases the repository maintainer
> hasn't bothered to enter any meaningful values for most of the entries
> so 'c' is generally the only reliable parameter (because it's
> automatically generated)

Got it. Can we try an "interactive" lesson? ;) Considering the following
real-case output:

apt-cache policy cdrecord
cdrecord:
  Installed: 8:2.01-0.a19.2
  Candidate: 8:2.01-0.a19.2
  Package Pin: 8:2.01-0.a19.2
  Version Table:
     8:2.01-0.fdr.5.a27.1 1001
        500 ftp://apt.kde-redhat.org fedora/1/stable pkglist
 *** 8:2.01-0.a19.2 1001
        500 http://ayo.freshrpms.net fedora/linux/1/i386/core pkglist
        100 RPM Database

what exactly can I infer from that? Only the "core" and "stable"
components?

> > Feel free to point me to some documentation if it is already there.
> > I browsed the APT HOWTO info at
> > http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html, but
> > IMHO it wasn't very complete with regards to these parameters.
> 
> Yep, there's not too much documentation about the gory details of
> pinning :(

Ok. IMHO it's a pitty, specially considering that, with more and more
repositories popping up, package pinning usefulness increases
proportionally.

Thks a lot for your help,

Andre

-- 
Andre Oliveira da Costa
([email protected])