diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index 2e8086d..52a7ee8 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -89,6 +89,32 @@ bitnami pkg:bitnami/wordpress@6.2.0?arch=arm64&distro=debian-12 pkg:bitnami/wordpress@6.2.0?arch=arm64&distro=photon-4 +brew +---- +``brew`` for Homebrew-based packages: + +- There is no default package repository; this should be implied either from + the ``namespace`` or using a tap URL via the ``tap_url`` qualifier. +- The ``namespace``, which is called a "Tap" in Homebrew terminology, defaults to ``homebrew/core``. + + - When the ``tap_url`` qualifier is not specified, the Tap identifier corresponds to the URL + ``https://github.com/{org}/homebrew-{tap}``, such as + ``https://github.com/homebrew/homebrew-core`` for ``homebrew/core``. + - When the ``tap_url`` qualifier is specified, the Tap identifier is the local name of the Tap. + +- The ``name`` is the formula name. Formula names that contain ``@`` must be percent-encoded, + such as ``postgresql%4012`` for ``postgres@12``. +- The ``version`` is the formula version. +- Qualifier ``tap_url``: for taps that are not on GitHub or otherwise require an explicit URL, + this is the full ``git`` URL to the tap. +- Examples:: + + pkg:brew/sqlite@3.43.2 + pkg:brew/postgresql%4012@12.17 + pkg:brew/homebrew/core/sqlite@3.43.2 + pkg:brew/some-org/some-tap/some-app@1.2.3 + pkg:brew/some-org/some-tap/some-app@1.2.3?tap_url=https://git.example.com/some-org/some-tap.git + cocoapods --------- ``cocoapods`` for CocoaPods: @@ -586,7 +612,6 @@ Other candidate types to define: - ``android`` for Android apk packages: - ``atom`` for Atom packages: - ``bower`` for Bower JavaScript packages: -- ``brew`` for Homebrew packages: - ``buildroot`` for Buildroot packages - ``carthage`` for Cocoapods Cocoa packages: - ``chef`` for Chef packages: diff --git a/test-suite-data.json b/test-suite-data.json index a819fc8..25276e7 100644 --- a/test-suite-data.json +++ b/test-suite-data.json @@ -550,5 +550,113 @@ "qualifiers": null, "subpath": null, "is_invalid": false + }, + { + "description": "brew names may contain at signs", + "purl": "pkg:brew/postgres%4016", + "canonical_purl": "pkg:brew/postgres%4016", + "type": "brew", + "namespace": null, + "name": "postgres@16", + "version": null, + "qualifiers": null, + "subpath": null, + "is_invalid": false + }, + { + "description": "brew may contain multiple at signs", + "purl": "pkg:brew/postgres@16@16.1", + "canonical_purl": "pkg:brew/postgres%4016@16.1", + "type": "brew", + "namespace": null, + "name": "postgres@16", + "version": "16.1", + "qualifiers": null, + "subpath": null, + "is_invalid": false + }, + { + "description": "brew may specify a namespace that uses the Homebrew default tap lookup mechanism", + "purl": "pkg:brew/some-org/some-tap/sqlite@3.43.2?tap_url=https://git.example.com/some-org/some-tap.git", + "canonical_purl": "pkg:brew/some-org/some-tap/sqlite@3.43.2?tap_url=https://git.example.com/some-org/some-tap.git", + "type": "brew", + "namespace": "some-org/some-tap", + "name": "sqlite", + "version": "3.43.2", + "qualifiers": { "tap_url": "https://git.example.com/some-org/some-tap.git"}, + "subpath": null, + "is_invalid": false + }, + { + "description": "brew may specify a namespace that uses the Homebrew default tap lookup mechanism", + "purl": "pkg:brew/some-org/some-tap/sqlite@3.43.2", + "canonical_purl": "pkg:brew/some-org/some-tap/sqlite@3.43.2", + "type": "brew", + "namespace": "some-org/some-tap", + "name": "sqlite", + "version": "3.43.2", + "qualifiers": null, + "subpath": null, + "is_invalid": false + }, + { + "description": "brew may specify a namespace that is its default repository", + "purl": "pkg:brew/homebrew/core/sqlite@3.43.2", + "canonical_purl": "pkg:brew/homebrew/core/sqlite@3.43.2", + "type": "brew", + "namespace": "homebrew/core", + "name": "sqlite", + "version": "3.43.2", + "qualifiers": null, + "subpath": null, + "is_invalid": false + }, + { + "description": "brew typical formula", + "purl": "pkg:brew/sqlite@3.43.2", + "canonical_purl": "pkg:brew/sqlite@3.43.2", + "type": "brew", + "namespace": null, + "name": "sqlite", + "version": "3.43.2", + "qualifiers": null, + "subpath": null, + "is_invalid": false + }, + { + "description": "invalid brew purl without name", + "purl": "pkg:brew/@0.9.1", + "canonical_purl": "pkg:brew/@0.9.1", + "type": "brew", + "namespace": null, + "name": null, + "version": "0.9.1", + "qualifiers": null, + "subpath": null, + "is_invalid": true + }, + { + "description": "invalid brew purl without version", + "purl": "pkg:brew/A3", + "canonical_purl": "pkg:brew/A3", + "type": "brew", + "namespace": null, + "name": "A3", + "version": null, + "qualifiers": null, + "subpath": null, + "is_invalid": true + }, + { + "description": "brew requires name and version at minimum", + "purl": "pkg:brew", + "canonical_purl": "pkg:brew", + "type": "brew", + "namespace": null, + "name": null, + "version": null, + "qualifiers": null, + "subpath": null, + "is_invalid": true } ]