Skip to content
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

Documentation: variable substitution in url templates #337

Closed
Gaeldrin opened this issue Jan 2, 2023 · 1 comment
Closed

Documentation: variable substitution in url templates #337

Gaeldrin opened this issue Jan 2, 2023 · 1 comment

Comments

@Gaeldrin
Copy link

Gaeldrin commented Jan 2, 2023

When using version substitution in url-template, it counts underscore as part of the variable name (which is ok) without any obvious way to make the underscore part of URL instead (which is not ok as it is impossible to construct real world URL), e.g.:

url: https://get.geo.opera.com/pub/opera/desktop/94.0.4606.38/linux/Opera_94.0.4606.38_amd64.deb
x-checker-data:
  type: anitya
  project-id: 7242
  url-template: https://get.geo.opera.com/pub/opera/desktop/$version/linux/Opera_$version_amd64.deb

results in:

ERROR src.manifest: Failed to check file opera/opera.deb with AnityaChecker: Error substituting template: 'version_amd64'

Edit: I could actually make it work by using folded brackets (e.g. Opera_${version}_amd64.deb) thanks to previous experience with shell but I still think that it could be improvement to mention this in the documentation (together with info if version is the only variable).

@wjt
Copy link
Contributor

wjt commented Jan 4, 2023

https://github.com/flathub/flatpak-external-data-checker#url-templates says:

If the placeholder is immediately followed by an underscore, you need to add braces:

and gives an example. Please open a pull request if you can think of a way to reword the documentation to make this clearer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants