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

Re: python-apt create_pin question



On Vi, 14 ian 22, 08:09:30, Antonio Russo wrote:
> 
> Hello!
> 
> I'm trying to use apt_pkg to get a "best candidate" for a package, but with
> slightly different constraints than I have set up in /etc/apt/preferences.d.
> 
> I am trying to use Policy.create_pin to do so, but cannot seem to get it working:
> 
> import apt_pkg
> 
> apt_pkg.init()
> cache = apt_pkg.Cache(progress=None)
> policy = apt_pkg.Policy(cache)
> #policy.create_pin('origin', '', 'Debian', -1)
> policy.create_pin('origin', 'apt', 'Debian', -1)
> policy.init_defaults()
> 
> print([ (v, policy.get_priority(v)) for v in cache['apt'].version_list ])
> 
> 
> All calls to get_priority return 500---not -1, as I am trying to get here.
> 
> I must be doing something silly.  I'd appreciate any help.

If you don't get an answer in a few more days you should probably try 
asking on https://lists.debian.org/deity instead.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

Attachment: signature.asc
Description: PGP signature


Reply to: