-
Notifications
You must be signed in to change notification settings - Fork 213
Add bsd package type #496
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
base: main
Are you sure you want to change the base?
Add bsd package type #496
Changes from all commits
a640aed
de6d1a0
676cffa
5e6adaa
d44e899
6cbc7ff
98aaf2e
a5643f4
7df8099
d60f925
69a8a99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "apk", | ||
| "bitbucket", | ||
| "bitnami", | ||
| "bsd", | ||
| "cargo", | ||
| "cocoapods", | ||
| "composer", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "$schema": "https://packageurl.org/schemas/purl-test.schema-1.0.json", | ||
| "tests": [ | ||
| { | ||
| "description": "Rountrip test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "roundtrip", | ||
| "input": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3", | ||
| "expected_output": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3", | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Build test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "build", | ||
| "input": { | ||
| "type": "bsd", | ||
| "namespace": "freebsd", | ||
| "name": "emacs", | ||
| "version": "30.1_2", | ||
| "qualifiers": { | ||
| "distro": "14.3", | ||
| "epoch": 3 | ||
| }, | ||
| "subpath": null | ||
| }, | ||
| "expected_output": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3", | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| }, | ||
| { | ||
| "description": "Parse test for <class 'type'> PURL", | ||
| "test_group": "base", | ||
| "test_type": "parse", | ||
| "input": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3", | ||
| "expected_output": { | ||
| "type": "bsd", | ||
| "namespace": "freebsd", | ||
| "name": "emacs", | ||
| "version": "30.1_2", | ||
| "qualifiers": { | ||
| "distro": "14.3", | ||
| "epoch": 3 | ||
| }, | ||
| "subpath": null | ||
| }, | ||
| "expected_failure": false, | ||
| "expected_failure_reason": null | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <!-- NOTE: Auto-generated from the JSON PURL type definition. | ||
| Do not manually edit this file. Edit the JSON type definition instead. --> | ||
|
|
||
| # PURL Type Definition: bsd | ||
|
|
||
| - **Type Name:** BSD | ||
| - **Description:** BSD Operating System variant packages, primarily focused on FreeBSD with extensibility for other BSD variants such as OpenBSD, DragonFly BSD. Note: since NetBSD's package manager is designed for cross-platform use, it should use its own dedicated PURL type. | ||
| - **Schema ID:** `https://packageurl.org/types/bsd-definition.json` | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why choose Bitname for types?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one needs to be probably added in some point but as I can't get anything out of that domain or URL it probably does not matter. |
||
| ## PURL Syntax | ||
|
|
||
| The structure of a PURL for this package type is: | ||
|
|
||
| pkg:bsd/<namespace>/<name>@<version>?<qualifiers>#<subpath> | ||
|
|
||
| ## Repository Information | ||
|
|
||
| - **Use Repository:** Yes | ||
| - **Note:** The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate. | ||
|
|
||
| ## Namespace definition | ||
|
|
||
| - **Requirement:** Required | ||
| - **Native Label:** vendor | ||
| - **Note:** `The namespace is the BSD variant name such as "freebsd", "openbsd", or "dragonflybsd". It is not case sensitive and must be lowercased.` | ||
|
|
||
| ## Name definition | ||
|
|
||
| - **Case Sensitive:** Yes | ||
| - **Native Label:** name | ||
| - **Note:** `The name is the package name and is case sensitive.` | ||
|
|
||
| ## Version definition | ||
|
|
||
| - **Native Label:** version | ||
| - **Note:** `The version is the version of the package.` | ||
|
|
||
| ## Qualifiers Definition | ||
|
|
||
| | Key | Requirement | Native name | Default Value | Description | | ||
| |------|-------------|-------------|---------------|-------------| | ||
| | arch | Optional | | | The target architecture for the package. | | ||
| | distro | Optional | | | The BSD release version or distribution variant. | | ||
| | epoch | Optional | | | The package epoch number used for version comparison when normal version ordering is insufficient. | | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As FreeBSD is going thru pkgbasecifcation how one could write that package is from base FreeBSD 15.1 and not ports? I would suggest add keys like these (they can go under different name):
With these one could write something like: Then would URL would translate to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @illuusio I agree to add something qualifier to distinguish how package is installed. But how can we get these information for each installed package? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion we have to trust people how write these PURLs. In perfect world it would be nice to have such info straight from pkg out generated. I don't know is this irrelevant to this but there were discussion about bit similar to this in mailing list PKGBASE Removes FreeBSD Base System Feature few weeks ago.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @illuusio Maybe we should leverage the existing known qualifiers such as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think they are needed at the beginning and hopefully magically things will be sorted out and they are not needed anymore as they make PURLs look gluttered to me. If they don't exist then just assume installation location is default one.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. I think we should keep it simple at this point:
This way, we can avoid premature specification while ensuring future extensibility when the underlying infrastructure supports it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think path goes that as 1. suggest we follow KISS and after this one has landed to PURL then start 2. as it can be little tricky part. As said we can't assume what will be supported by |
||
| ## Examples | ||
|
|
||
| - `pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3` | ||
| - `pkg:bsd/freebsd/[email protected]?distro=14.3` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json", | ||
| "$id": "https://packageurl.org/types/bsd-definition.json", | ||
| "type": "bsd", | ||
| "type_name": "BSD", | ||
| "description": "BSD Operating System variant packages, primarily focused on FreeBSD with extensibility for other BSD variants such as OpenBSD, DragonFly BSD. Note: since NetBSD's package manager is designed for cross-platform use, it should use its own dedicated PURL type.", | ||
| "repository": { | ||
| "use_repository": true, | ||
| "note": "The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate." | ||
| }, | ||
| "namespace_definition": { | ||
| "native_name": "vendor", | ||
| "is_case_sensitve": false, | ||
| "note": "The namespace is the BSD variant name such as \"freebsd\", \"openbsd\", or \"dragonflybsd\". It is not case sensitive and must be lowercased.", | ||
| "requirement": "required" | ||
| }, | ||
| "name_definition": { | ||
| "note": "The name is the package name and is case sensitive.", | ||
| "case_sensitive": true, | ||
| "native_name": "name" | ||
| }, | ||
| "version_definition": { | ||
| "native_name": "version", | ||
| "note": "The version is the version of the package." | ||
| }, | ||
| "qualifiers_definition": [ | ||
| { | ||
| "key": "arch", | ||
| "description": "The target architecture for the package." | ||
| }, | ||
| { | ||
| "key": "distro", | ||
| "description": "The BSD release version or distribution variant." | ||
| }, | ||
| { | ||
| "key": "epoch", | ||
| "description": "The package epoch number used for version comparison when normal version ordering is insufficient." | ||
| } | ||
| ], | ||
| "examples": [ | ||
| "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3", | ||
| "pkg:bsd/freebsd/[email protected]?distro=14.3" | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct URL or is server down as this just returns HTTP server is too slow for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I just followed other purl type examples.
@pombredanne Do you know anything about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server will be up in the new few days ;)