From 5e94a6519b0e14d58c00b8f316adb8d86d7cc1e3 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Mon, 4 Dec 2023 18:14:17 -0500 Subject: [PATCH 01/10] Add spec for `brew` package URLs Signed-off-by: William Woodruff --- PURL-TYPES.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index 1ace3bd..0fe0d79 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -87,6 +87,25 @@ bitnami pkg:bitnami/wordpress@6.2.0 pkg:bitnami/wordpress@6.2.0?arch=arm64 +brew +---- +``brew`` for Homebrew-based packages: + +- The default repository (tap) is ``homebrew/core``. + + - The tap syntax is ``https://github.com/{org}/Homebrew-{tap}``, so + ``homebrew/core`` corresponds to the URL ``https://github.com/homebrew/homebrew-core``. +- The ``name`` is the formula name. +- 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 URL to the tap. +- Examples:: + + pkg:brew/sqlite@3.43.2 + 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: From d1ebec944ee7a655a872e7ad0920bf63b1721799 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 8 Dec 2023 16:32:22 -0500 Subject: [PATCH 02/10] Apply suggestions from code review Co-authored-by: Colin Dean --- PURL-TYPES.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index 0fe0d79..067bbf2 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -91,10 +91,10 @@ brew ---- ``brew`` for Homebrew-based packages: -- The default repository (tap) is ``homebrew/core``. +- The default repository, which is called a "Tap" in Homebrew terminology, is ``homebrew/core``. - - The tap syntax is ``https://github.com/{org}/Homebrew-{tap}``, so - ``homebrew/core`` corresponds to the URL ``https://github.com/homebrew/homebrew-core``. + - The typical tap identifier expands to the URL ``https://github.com/{org}/Homebrew-{tap}``, so the tap identifier + ``homebrew/core`` corresponds to the tap URL ``https://github.com/homebrew/homebrew-core``. - The ``name`` is the formula name. - The ``version`` is the formula version. - Qualifier ``tap_url``: for taps that are not on GitHub or otherwise require an explicit URL, @@ -104,7 +104,7 @@ brew pkg:brew/sqlite@3.43.2 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 + pkg:brew/some-org/some-tap/some-app@1.2.3?tap_url=https://git.example.com/some-org/some-tap.git cocoapods --------- From 9ae6363365ff5c50f0b00184e3448970e7779634 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 8 Dec 2023 16:38:33 -0500 Subject: [PATCH 03/10] Apply suggestions from code review Co-authored-by: Colin Dean --- PURL-TYPES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index 067bbf2..cebd9ec 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -95,6 +95,7 @@ brew - The typical tap identifier expands to the URL ``https://github.com/{org}/Homebrew-{tap}``, so the tap identifier ``homebrew/core`` corresponds to the tap URL ``https://github.com/homebrew/homebrew-core``. + - Any git URL is a valid tap URL (see ``tap_url``) - The ``name`` is the formula name. - The ``version`` is the formula version. - Qualifier ``tap_url``: for taps that are not on GitHub or otherwise require an explicit URL, From ca87bddc752e1097a386e80e6b46cbe8b4e36fb2 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 8 Dec 2023 16:39:34 -0500 Subject: [PATCH 04/10] reflow Signed-off-by: William Woodruff --- PURL-TYPES.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index cebd9ec..2540751 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -93,9 +93,11 @@ brew - The default repository, which is called a "Tap" in Homebrew terminology, is ``homebrew/core``. - - The typical tap identifier expands to the URL ``https://github.com/{org}/Homebrew-{tap}``, so the tap identifier - ``homebrew/core`` corresponds to the tap URL ``https://github.com/homebrew/homebrew-core``. + - The typical tap identifier expands to the URL ``https://github.com/{org}/Homebrew-{tap}``, so + the tap identifier ``homebrew/core`` corresponds to the tap URL + ``https://github.com/homebrew/homebrew-core``. - Any git URL is a valid tap URL (see ``tap_url``) + - The ``name`` is the formula name. - The ``version`` is the formula version. - Qualifier ``tap_url``: for taps that are not on GitHub or otherwise require an explicit URL, From 9f288b080763bf3ae92c5b66972c2a5d8564a069 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 8 Dec 2023 16:44:59 -0500 Subject: [PATCH 05/10] Update PURL-TYPES.rst Co-authored-by: Colin Dean --- PURL-TYPES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index 2540751..acf9fea 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -105,6 +105,7 @@ brew - 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 From ba01dcb30fdfc773fbd46a053cfb7214653f34ee Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 8 Dec 2023 17:36:50 -0500 Subject: [PATCH 06/10] more disambiguation Signed-off-by: William Woodruff --- PURL-TYPES.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index acf9fea..b62de0b 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -91,17 +91,20 @@ brew ---- ``brew`` for Homebrew-based packages: -- The default repository, which is called a "Tap" in Homebrew terminology, is ``homebrew/core``. +- 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``. - - The typical tap identifier expands to the URL ``https://github.com/{org}/Homebrew-{tap}``, so - the tap identifier ``homebrew/core`` corresponds to the tap URL - ``https://github.com/homebrew/homebrew-core``. - - Any git URL is a valid tap URL (see ``tap_url``) + - 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. +- 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 URL to the tap. + this is the full ``git`` URL to the tap. - Examples:: pkg:brew/sqlite@3.43.2 From 2d0348dad32fe529e001ae6eaade259747d75609 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Mon, 17 Jun 2024 15:38:16 -0400 Subject: [PATCH 07/10] Adds two Homebrew purl test cases from @matt-phylum Copypasted verbatim from https://github.com/package-url/purl-spec/pull/281#issuecomment-2173286229 --- test-suite-data.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test-suite-data.json b/test-suite-data.json index a819fc8..9b43e72 100644 --- a/test-suite-data.json +++ b/test-suite-data.json @@ -550,5 +550,29 @@ "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 } ] From 0ecae1bbe7fe7cf8671021fdf1d3455dcc00abd7 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Mon, 17 Jun 2024 15:57:30 -0400 Subject: [PATCH 08/10] Adds Homebrew test cases --- test-suite-data.json | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/test-suite-data.json b/test-suite-data.json index 9b43e72..4475a19 100644 --- a/test-suite-data.json +++ b/test-suite-data.json @@ -574,5 +574,89 @@ "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": "https://git.example.com/some-org/some-tap.git", + "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 } ] From ac6e58217a808ac0d550ad236c25b0455833cd3d Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 18 Jun 2024 13:30:37 -0400 Subject: [PATCH 09/10] Update test-suite-data.json Co-authored-by: Colin Dean --- test-suite-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-suite-data.json b/test-suite-data.json index 4475a19..25276e7 100644 --- a/test-suite-data.json +++ b/test-suite-data.json @@ -580,7 +580,7 @@ "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": "https://git.example.com/some-org/some-tap.git", + "namespace": "some-org/some-tap", "name": "sqlite", "version": "3.43.2", "qualifiers": { "tap_url": "https://git.example.com/some-org/some-tap.git"}, From f8fd63ef0bfe615be0aaefb68257080afd56cae2 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Thu, 17 Oct 2024 12:21:50 -0400 Subject: [PATCH 10/10] PURL-TYPES: remove brew from TODO list Signed-off-by: William Woodruff --- PURL-TYPES.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/PURL-TYPES.rst b/PURL-TYPES.rst index b62de0b..8958f01 100644 --- a/PURL-TYPES.rst +++ b/PURL-TYPES.rst @@ -554,7 +554,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: