Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #244111
| From | Michael Lange <klappnase@freenet.de> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: python-apt create_pin question |
| Date | 2022-01-17 11:10 +0100 |
| Message-ID | <DGx7A-7lc-7@gated-at.bofh.it> (permalink) |
| References | <DFwQi-8v6-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi,
On Fri, 14 Jan 2022 08:09:30 -0700
Antonio Russo <aerusso@aerusso.net> wrote:
(...)
> 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()
(...)
> 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.
just a shot into the dark:
According to
https://apt-team.pages.debian.net/python-apt/library/apt_pkg.html :
"The parameter type refers to one of the strings ‘Version’, ‘Release’,
or ‘Origin’. "
So maybe this argument is case sensitive and changing "origin" into
"Origin" may fix the issue?
Best regards
Michael
.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.
Not one hundred percent efficient, of course ... but nothing ever is.
-- Kirk, "Metamorphosis", stardate 3219.8
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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