Closed 0xDEC0DE closed 2 years ago
Clarification: when using Multiple Options, Click says:
When passing a
default
withmultiple=True
, the default value must be a list or tuple, otherwise it will be interpreted as a list of single characters.
Additional clarification:
The problem with the epoch in source packages is that it is not a part of the sourcerpm
filename. To demonstrate, load a set of repos:
>>> import repomd
>>> herp = repomd.load('https://vault.centos.org/centos/8/BaseOS/Source/')
>>> derp = repomd.load('https://vault.centos.org/centos/8/BaseOS/x86_64/os/')
Now, picking an "interesting" package, note that the epoch is returned/known about, but not encoded in the sourcerpm
filename:
>>> derp.findall('device-mapper-libs')
[<Package: "device-mapper-libs-8:1.02.175-5.el8.i686">, <Package: "device-mapper-libs-8:1.02.175-5.el8.x86_64">]
>>> derp.findall('device-mapper-libs')[0].sourcerpm
'lvm2-2.03.11-5.el8.src.rpm'
Similarly, the source repo is aware of the epoch:
>>> herp.findall('lvm2')
[<Package: "lvm2-8:2.03.11-5.el8.src">]
>>> herp.findall('lvm2')[0].evr
'8:2.03.11-5.el8'
...but the soufi
code has no way of knowing what the epoch is, because it simply splits up the filename to get the EVR fields. There is an epoch-less attribute that can be used instead, however:
>>> herp.findall('lvm2')[0].vr
'2.03.11-5.el8'
Fixed by #12
Steps to reproduce
Expected result
Actual behavior
Errata
repo
Click option isdefault=None, multiple=True
, which Click says "do not do this" (https://click.palletsprojects.com/en/8.0.x/options/#multiple-options) and it automagically converts into an empty tuple for you. This means therepos is not None:
comparison inCentosFinder.__init__
ALWAYS hits.