Skip to content

Commit 76308de

Browse files
committed
CPEs now support versions too
See msys2/msys2-devtools#13
1 parent bd288f8 commit 76308de

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

web/dev/pkgbuild.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ For `msys2_references` the following keys are recognized:
3131
* `gentoo` - the full Gentoo package name e.g. `dev-python/pyasn1`
3232
* `internal` - special key, which if it exists marks the package as internal and doesn't link it to any external sources
3333
* `purl` - a [package URL](https://github.com/package-url/purl-spec). Multiple PURLs supported. Versions are optionally supported, and useful in case the upstream version is different from the package version. Some common PURL types:
34-
* [pypi](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#pypi) - example: `pkg:pypi/jinja2` or `pkg:pypi/@3.1.5` - make sure to [normalize](https://packaging.python.org/en/latest/specifications/name-normalization) the package name
35-
* [cargo](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#cargo) - example: `pkg:cargo/ripgrep` or `pkg:cargo/[email protected]`
36-
* [gem](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#gem) - example: `pkg:gem/asciidoctor`
37-
* [github](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#github) - example: `pkg:github/curl/curl` or `pkg:github/curl/curl@curl-8_12_1`
38-
* ...
39-
* `cpe` - a [CPE](https://en.wikipedia.org/wiki/Common_Platform_Enumeration) prefix, either in the 2.2 format (`cpe: cpe:/a:gnu:gcc`) or the 2.3 format (`cpe:2.3:a:gnu:gcc`). `version`, `target_sw` etc are currently not supported. Multiple CPEs supported.
34+
* [pypi](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#pypi) - example: `pkg:pypi/jinja2` or `pkg:pypi/@3.1.5` - make sure to [normalize](https://packaging.python.org/en/latest/specifications/name-normalization) the package name
35+
* [cargo](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#cargo) - example: `pkg:cargo/ripgrep` or `pkg:cargo/[email protected]`
36+
* [gem](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#gem) - example: `pkg:gem/asciidoctor`
37+
* [github](https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#github) - example: `pkg:github/curl/curl` or `pkg:github/curl/curl@curl-8_12_1`
38+
* ...
39+
* `cpe` - a [CPE](https://en.wikipedia.org/wiki/Common_Platform_Enumeration) prefix, either in the 2.2 or the 2.3 format. Versions are optionally supported, and useful in case the upstream version is different from the package version (`cpe:/a:gnu:gcc:14.2.0`).
40+
41+
* 2.2: `cpe:/a:gnu:gcc` or `cpe:/a:gnu:gcc:14.2.0`
42+
* 2.3: `cpe:2.3:a:gnu:gcc` or `cpe:2.3:a:gnu:gcc:14.2.0`
4043

4144
Defining a key without a value means there is no mapping and the package shouldn't be linked.
4245

web/dev/vulnerabilities.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ Example:
2121

2222
```bash
2323
msys2_references=(
24+
"purl: pkg:pypi/cryptography"
2425
"cpe: cpe:/a:python-cryptography_project:python-cryptography"
2526
"cpe: cpe:2.3:a:cryptography_project:cryptography"
26-
"purl: pkg:pypi/cryptography"
2727
)
2828
```
2929

30-
In case the version format of the referenced ecosystem is different from the PKGBUILD version, you can specify the version in the `purl` field:
30+
In case the version format of the referenced ecosystem is different from the PKGBUILD version, you can specify the version:
3131

3232
```bash
3333
pkgver=1.0dev1
3434
_pypiver=1.0.dev1
3535
msys2_references=(
3636
"purl: pkg:pypi/example@${_pypiver}"
37+
"cpe: cpe:/a:example:example:${_pypiver}"
38+
"cpe: cpe:2.3:a:example:example:${_pypiver}"
3739
)
3840
```
3941

0 commit comments

Comments
 (0)