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

Github tags/releases with a / in the prefix #147

Open
jloehel opened this issue Mar 1, 2024 · 0 comments
Open

Github tags/releases with a / in the prefix #147

jloehel opened this issue Mar 1, 2024 · 0 comments

Comments

@jloehel
Copy link

jloehel commented Mar 1, 2024

Examples:

https://github.com/apache/logging-log4net/archive/refs/tags/rc/2.0.8-RC1.zip
https://github.com/apache/logging-log4net/tree/rel/2.0.8

Parsing those will result in:

❯ pip show packageurl-python
Name: packageurl-python
Version: 0.14.0
Summary: A purl aka. Package URL parser and builder
Home-page: https://github.com/package-url/packageurl-python
Author: the purl authors
Author-email: 
License: MIT
Location: /home/jloehel/python/venv3.9/lib/python3.9/site-packages
Requires: 
Required-by: 
❯ python
Python 3.9.18 (main, Sep 06 2023, 07:49:32) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from packageurl.contrib import url2purl
>>> url2purl.get_purl("https://github.com/apache/logging-log4net/archive/refs/tags/rc/2.0.8-RC1.zip")
PackageURL(type='github', namespace='apache', name='logging-log4net', version='2.0.8-RC1', qualifiers={}, subpath=None)
>>> url2purl.get_purl("https://github.com/apache/logging-log4net/tree/rel/2.0.8")
PackageURL(type='github', namespace='apache', name='logging-log4net', version='rel', qualifiers={}, subpath='2.0.8')
>>>

For the first URI the version is correct but the prefix gets lost. How can I re-construct a working URI from it? The second URI does not work. The version_prefix is the version and the version is the subpath.

Expected result:

pkg:github/apache/[email protected]?version_prefix=rc%2F
pkg:github/apache/[email protected]?version_prefix=rel%2F

Note: https://github.com/apache/logging-log4net/tree/rel/2.0.8 is really tricky and I think not possible to realize just with regular expressions. It would be necessary to know about the existing refs.

@jloehel jloehel changed the title Github tags/release with a / in the prefix Github tags/releases with a / in the prefix Mar 1, 2024
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

1 participant