Skip to content

Commit a640aed

Browse files
committed
Add bsd package type
1 parent 71e9042 commit a640aed

File tree

4 files changed

+146
-0
lines changed

4 files changed

+146
-0
lines changed

purl-types-index.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"apk",
44
"bitbucket",
55
"bitnami",
6+
"bsd",
67
"cargo",
78
"cocoapods",
89
"composer",

tests/types/bsd-test.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "https://packageurl.org/schemas/purl-test.schema-1.0.json",
3+
"tests": [
4+
{
5+
"description": "Rountrip test for <class 'type'> PURL",
6+
"test_group": "base",
7+
"test_type": "roundtrip",
8+
"input": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3",
9+
"expected_output": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3",
10+
"expected_failure": false,
11+
"expected_failure_reason": null
12+
},
13+
{
14+
"description": "Build test for <class 'type'> PURL",
15+
"test_group": "base",
16+
"test_type": "build",
17+
"input": {
18+
"type": "bsd",
19+
"namespace": "freebsd",
20+
"name": "emacs",
21+
"version": "30.1_2",
22+
"qualifiers": {
23+
"distro": "14.3",
24+
"epoch": 3
25+
},
26+
"subpath": null
27+
},
28+
"expected_output": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3",
29+
"expected_failure": false,
30+
"expected_failure_reason": null
31+
},
32+
{
33+
"description": "Parse test for <class 'type'> PURL",
34+
"test_group": "base",
35+
"test_type": "parse",
36+
"input": "pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3",
37+
"expected_output": {
38+
"type": "bsd",
39+
"namespace": "freebsd",
40+
"name": "emacs",
41+
"version": "30.1_2",
42+
"qualifiers": {
43+
"distro": "14.3",
44+
"epoch": 3
45+
},
46+
"subpath": null
47+
},
48+
"expected_failure": false,
49+
"expected_failure_reason": null
50+
}
51+
]
52+
}

types-doc/bsd-definition.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!-- NOTE: Auto-generated from the JSON PURL type definition.
2+
Do not manually edit this file. Edit the JSON type definition instead. -->
3+
4+
# PURL Type Definition: bsd
5+
6+
- **Type Name:** BSD
7+
- **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.
8+
- **Schema ID:** `https://packageurl.org/types/bsd-definition.json`
9+
10+
## PURL Syntax
11+
12+
The structure of a PURL for this package type is:
13+
14+
pkg:bsd/<namespace>/<name>@<version>?<qualifiers>#<subpath>
15+
16+
## Repository Information
17+
18+
- **Use Repository:** Yes
19+
- **Note:** The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate.
20+
21+
## Namespace definition
22+
23+
- **Requirement:** Required
24+
- **Native Label:** vendor
25+
- **Note:** `The namespace is the BSD variant name such as "freebsd", "openbsd", or "dragonflybsd". It is not case sensitive and must be lowercased.`
26+
27+
## Name definition
28+
29+
- **Case Sensitive:** Yes
30+
- **Native Label:** name
31+
- **Note:** `The name is the package name and is case sensitive.`
32+
33+
## Version definition
34+
35+
- **Native Label:** version
36+
- **Note:** `The version is the version of the package.`
37+
38+
## Qualifiers Definition
39+
40+
| Key | Requirement | Native name | Default Value | Description |
41+
|------|-------------|-------------|---------------|-------------|
42+
| arch | Optional | | | The target architecture for the package. |
43+
| distro | Optional | | | The BSD release version or distribution variant. |
44+
| epoch | Optional | | | The package epoch number used for version comparison when normal version ordering is insufficient. |
45+
46+
## Examples
47+
48+
- `pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3`
49+
- `pkg:bsd/freebsd/[email protected]?distro=14.3`

types/bsd-definition.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json",
3+
"$id": "https://packageurl.org/types/bsd-definition.json",
4+
"type": "bsd",
5+
"type_name": "BSD",
6+
"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.",
7+
"repository": {
8+
"use_repository": true,
9+
"note": "The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate."
10+
},
11+
"namespace_definition": {
12+
"native_name": "vendor",
13+
"is_case_sensitve": false,
14+
"note": "The namespace is the BSD variant name such as \"freebsd\", \"openbsd\", or \"dragonflybsd\". It is not case sensitive and must be lowercased.",
15+
"requirement": "required"
16+
},
17+
"name_definition": {
18+
"note": "The name is the package name and is case sensitive.",
19+
"case_sensitive": true,
20+
"native_name": "name"
21+
},
22+
"version_definition": {
23+
"native_name": "version",
24+
"note": "The version is the version of the package."
25+
},
26+
"qualifiers_definition": [
27+
{
28+
"key": "arch",
29+
"description": "The target architecture for the package."
30+
},
31+
{
32+
"key": "distro",
33+
"description": "The BSD release version or distribution variant."
34+
},
35+
{
36+
"key": "epoch",
37+
"description": "The package epoch number used for version comparison when normal version ordering is insufficient."
38+
}
39+
],
40+
"examples": [
41+
"pkg:bsd/freebsd/[email protected]_2?distro=14.3&epoch=3",
42+
"pkg:bsd/freebsd/[email protected]?distro=14.3"
43+
]
44+
}

0 commit comments

Comments
 (0)