Comments (8)
@armijnhemel that's a great feature!
@TG1999 what do you think?
from packageurl-python.
Yes sure @pombredanne , can we get some sample input and outputs, so we can think of a mapping for same
from packageurl-python.
I realize that from a plain package you cannot determine the distro such as "debian" or "fedora". I think it would be acceptable to assume that this would be supplied as a parameter or to set it to a generic value, which can later be changed or overridden.
from packageurl-python.
Package to purl string could be like this:
babeld_1.8.3-1_amd64.deb -> pkg:deb/[email protected]?arch=amd64
bash-5.1.0-2.fc34.x86_64.rpm -> pkg:rpm/fedora/[email protected]?arch=x86_64
Optionally, because there is 'fc34' in the name you could conclude that it is Fedora 34, but I wouldn't do that, as I can see that there are packages in Fedora 34 that have fc33
in the name.
Currently when feeding these purl strings to PackageURL.from_string gives me:
packageurl.PackageURL.from_string('pkg:rpm/[email protected]?arch=x86_64')
PackageURL(type='rpm', namespace=None, name='bash', version='5.1.0-2', qualifiers={'arch': 'x86_64'}, subpath=None)
so I could imagine the identical output for the proposed method:
packageurl.PackageURL.from_package_name('bash-5.1.0-2.fc34.x86_64.rpm')
PackageURL(type='rpm', namespace=None, name='bash', version='5.1.0-2', qualifiers={'arch': 'x86_64'}, subpath=None)
from packageurl-python.
@armijnhemel thanks! that's clear.
from packageurl-python.
@armijnhemel would this be only for .deb and .rpm?
from packageurl-python.
@armijnhemel would this be only for .deb and .rpm?
For now yes. In the future I could also envision ipkg
(extension: ipk
) and possibly others (Python wheel, etc.).
from packageurl-python.
FWIW, we have a lot of these in url2purl... but for full URLs, not mere package archives
>>> url2purl("https://files.pythonhosted.org/packages/a1/eb/b37ef5647243ade8308f7bb46b1a45e6204790c163cbd8cf6df990d5c1c1/boolean.py-3.8.tar.gz")
PackageURL(type='pypi', namespace=None, name='boolean.py', version='3.8', qualifiers={}, subpath=None)
and not yet for debian and RPMs
from packageurl-python.
Related Issues (20)
- Promote version 0.11 from 0.11.0rc1 HOT 3
- Add 'gem' route for purl2url HOT 1
- Return empty purl fields in purl_to_lookups
- Fails to return the version if dependencies are specified HOT 1
- Normalize for qualifiers HOT 5
- Add support for RPM distros in url2purl and purl2ulrl HOT 1
- Add support for bitbucket and gitlab in purl2url to get download URLs HOT 1
- purl.fyi: Convert all purl to URLs seamlessly HOT 1
- no proper release in GitHub for version 0.11.2 HOT 1
- Should PyPI Purl Versions have `_` replaced with `-` (like Name) HOT 1
- Incorrect parsing for PURLs without names HOT 2
- Provide support for Gitlab versioning HOT 1
- Parsing regression for Golang in 0.12.0 release HOT 1
- Improve support for SourceForge URLs HOT 1
- May be vulnerable to `npmjs.evil.com`, `evilpython.org`, `evilsourceforge.net` and more HOT 1
- Add support for additional packages in purl2url HOT 10
- [Discussion] Sourceforge download patterns HOT 1
- Github tags/releases with a `/` in the prefix
- Creation PackageURL objects for invalid PURLs / Possible improper encoding of colons (":") in PURL fields HOT 1
- PackageURL not properly re-encoding strings when rendering to string HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packageurl-python.