Apt pinning wildcards

Kernels & Hardware, configuring network, installing services

Apt pinning wildcards

Postby rpglover64 » 2009-10-23 18:06

Is it possible to do something like this:

Package: ghc6*
Pin: release a=unstable
Pin-Priority: 701

Package: libghc6*
Pin: release a=unstable
Pin-Priority: 701

and have it actually do what I want?

i.e. can you pin on a regex or a glob that matches a name?
rpglover64
 
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

Postby bugsbunny » 2009-10-23 18:49

No you can't. If you could I wouldn't need this:
Package: clamav clamav-base clamav-daemon clamav-docs clamav-freshclam libclamav6
Pin: release a=unstable,o=Debian
Pin-Priority: 900
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Apt pinning wildcards

Postby rpglover64 » 2009-10-23 18:53

:(

Feature request?
rpglover64
 
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

Postby craigevil » 2009-10-23 20:35

You can't use wildcards for a package, but if you are running testing and just want to hold all packages from unstable you can something like:

Package: *
Pin: release a=experimental
Pin-Priority: 101

I do that when I have packages from exp installed and it works just fine.
Debian Sid KDE Kernel 3.17 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5192
Joined: 2006-09-17 03:17
Location: Oz

Re: Apt pinning wildcards

Postby rpglover64 » 2009-10-24 00:52

So I have both unstable and stable pinned lower than testing. however, when it comes to haskell, I would like to have unstable packages to be the default.
rpglover64
 
Posts: 5
Joined: 2009-10-23 17:59

Re: Apt pinning wildcards

Postby bugsbunny » 2009-10-24 06:18

rpglover64 wrote:So I have both unstable and stable pinned lower than testing. however, when it comes to haskell, I would like to have unstable packages to be the default.

A minor pain to setup, since there's a fair number of packages involved. But it's only a one time setup, with possibly some maintenance down the road if some packages change names.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Apt pinning wildcards

Postby bugsbunny » 2009-10-24 06:29

This might help you a bit :)
Code: Select all
aptitude search ~n"haskell~|ghc6" -F"%p"|sed 's?\([^ ]*\)?Package: \1\nPin: release a=unstable\nPin-Priority: 701\n?'


You may want to think about making the output a separate file and dropping it into /etc/apt/preferences.d/.
The result will require a bit more editing. For one the "blank lines" may actually contain spaces, which will make apt-cache (at least) unhappy. You'll also get some not found packages if they don't exist in unstable. How to correct those problems I'll leave as an exercise for you to figure out (it's not difficult to solve either of those).
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Apt pinning wildcards

Postby rpglover64 » 2009-10-26 00:54

Thank you.
rpglover64
 
Posts: 5
Joined: 2009-10-23 17:59


Return to System configuration

Who is online

Users browsing this forum: kedaha and 4 guests

fashionable