-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternate version matching with string rather than int to handle 0-prefixed numbers (failed ghostscript version check since version 10.01.0) #360
Comments
P.S.: checking the code, looking if such alternate variables already exist, I clearly see the problem: from distutils.version import LooseVersion
[…]
version_list = LooseVersion(version).version
[…]
for i, version_part in enumerate(version_list): And checking how this module works, testing in a console: In [4]: l = LooseVersion("10.01.0")
In [5]: l.version
Out[5]: [10, 1, 0] So in |
You can use the json checker as a workaround. Try: "x-checker-data": {
"type": "json",
"url": "https://api.github.com/repos/ArtifexSoftware/ghostpdl-downloads/releases/latest",
"version-query": ".name | split(\" \") | .[1]",
"url-query": ".assets[] | select(.name|test(\"^ghostscript-(.*).tar.gz$\")) | .browser_download_url"
}
|
Our current url-template substitution doesn't work and there seem to be no alternative right now using anitya checker. So switching to another checker. See: flathub-infra/flatpak-external-data-checker#360
Thanks. Works fine! |
f-strings are not an option for untrusted input, since it would open up a very simple way to ACE. But maybe there is another library that can be used for string template (something like jinja2 but simpler)? |
- poppler: 23.02.0 → 23.04.0 - ghostscript: 10.0.0 → 10.01.0 (also fixes the anitya check, see: flathub-infra/flatpak-external-data-checker#360) - OpenBLAS: 0.3.21 ⇒ 0.3.23 - libheif: 1.15.1 ⇒ 1.15.2 - GEGL: 0.4.42 ⇒ 0.4.44
One of the tests exercises the ability to use parsed components of versions in URL patterns. Ghostscript uses version numbers of the form 10.01.0. Since the components are treated as digits, the $version1 variable is set to "1" not "01", and so this test fails. See #360. To work around this bug to unbreak the test suite, switch to a different module.
The version checker started to fail for Ghostscript, after release of version 10.01.0. We use the anitya
x-data-checker
'stype
(though this issue might happen with other data checkers, I haven't verified) and here is our current manifest code for GIMP:Finally here is an example of failed build log error because of the version check:
The right URL is: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10010/ghostscript-10.01.0.tar.gz
Basically it seems that the substitution code replaces
$minor
by1
while the exact scheme for ghostscript apparently expects01
(i.e. taking the version number as a string as-is, keeping the leading0
, rather than an int), which very likely means that there is a roundtrip toint
type.Though it might be the used scheme in some cases, in others (e.g. for ghostscript), it's not. So we'd need alternative substitution variables to handle such case.
Also do you know if there is a workaround for now (other than removing the version check for this module)? Because right now all builds fail on Flathub because of this.
The text was updated successfully, but these errors were encountered: