Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #244021

Re: python-apt create_pin question

From Andrei POPESCU <andreimpopescu@gmail.com>
Newsgroups linux.debian.user
Subject Re: python-apt create_pin question
Date 2022-01-15 18:40 +0100
Message-ID <DFVbY-7PK-33@gated-at.bofh.it> (permalink)
References <DFwQi-8v6-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

python-apt create_pin question Antonio Russo <aerusso@aerusso.net> - 2022-01-14 16:40 +0100
  Re: python-apt create_pin question Andrei POPESCU <andreimpopescu@gmail.com> - 2022-01-15 18:40 +0100
  Re: python-apt create_pin question Michael Lange <klappnase@freenet.de> - 2022-01-17 11:10 +0100
    Re: python-apt create_pin question Antonio Russo <aerusso@aerusso.net> - 2022-01-17 16:20 +0100

csiph-web