Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs
@ 2026-08-25 10:44 KAZUYOSHI AKIYAMA (秋山 和慶)
  2026-09-08 14:44 ` Joshua Watt
  0 siblings, 1 reply; 5+ messages in thread
From: KAZUYOSHI AKIYAMA (秋山 和慶) @ 2026-08-25 10:44 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org
  Cc: JPEWhacker@gmail.com, stondo@gmail.com

_generate_git_purl() generates invalid PURLs of the form
`pkg:github/<owner>/<repo>@<rev>@<rev>`.
purl-spec only allows a single `@<rev>`.

oe.spdx_common.fetch_data_to_uri() already appends "@<rev>" to the
download location, and urlparse() leaves that suffix in parsed.path.
Therefore, the parsed repository name(`{repo}`) includes `@<rev>`.
So, need to strip the revision suffix before splitting out
the owner(`{owner}`) and the repository name(`{repo}`).

While here, replace str.replace(".git", "") with str.removesuffix() so
repository names that contain ".git" elsewhere are preserved.

Signed-off-by: Kazuyoshi Akiyama <kazuyoshi_akiyama@jp.honda>
---
 meta/lib/oe/spdx30_tasks.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index dac02e3784..b2f208e1f6 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -379,11 +379,14 @@ def _generate_git_purl(d, download_location, srcrev):
 
     for domain, purl_type in git_purl_handlers.items():
         if hostname == domain:
-            path = parsed.path.strip("/")
+            # oe.spdx_common.fetch_data_to_uri() appends "@<rev>" to the
+            # download location, which must not become part of the
+            # repository name
+            path = parsed.path.strip("/").partition("@")[0]
             path_parts = path.split("/")
             if len(path_parts) >= 2:
                 owner = path_parts[0]
-                repo = path_parts[1].replace(".git", "")
+                repo = path_parts[1].removesuffix(".git")
                 return f"{purl_type}/{owner}/{repo}@{srcrev}"
             break
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs
  2026-08-25 10:44 [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs KAZUYOSHI AKIYAMA (秋山 和慶)
@ 2026-09-08 14:44 ` Joshua Watt
  2026-10-30  0:09   ` [OE-core] " KAZUYOSHI AKIYAMA (秋山 和慶)
  0 siblings, 1 reply; 5+ messages in thread
From: Joshua Watt @ 2026-09-08 14:44 UTC (permalink / raw)
  To: KAZUYOSHI AKIYAMA (秋山 和慶)
  Cc: openembedded-core@lists.openembedded.org, stondo@gmail.com

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]

On Tue, Aug 25, 2026 at 4:44 AM KAZUYOSHI AKIYAMA (秋山 和慶)
<kazuyoshi_akiyama@jp.honda> wrote:

> _generate_git_purl() generates invalid PURLs of the form
> `pkg:github/<owner>/<repo>@<rev>@<rev>`.
> purl-spec only allows a single `@<rev>`.
>
> oe.spdx_common.fetch_data_to_uri() already appends "@<rev>" to the
> download location, and urlparse() leaves that suffix in parsed.path.
> Therefore, the parsed repository name(`{repo}`) includes `@<rev>`.
> So, need to strip the revision suffix before splitting out
> the owner(`{owner}`) and the repository name(`{repo}`).
>
> While here, replace str.replace(".git", "") with str.removesuffix() so
> repository names that contain ".git" elsewhere are preserved.
>
> Signed-off-by: Kazuyoshi Akiyama <kazuyoshi_akiyama@jp.honda>
>

LGTM, thank.

Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>



> ---
>  meta/lib/oe/spdx30_tasks.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
> index dac02e3784..b2f208e1f6 100644
> --- a/meta/lib/oe/spdx30_tasks.py
> +++ b/meta/lib/oe/spdx30_tasks.py
> @@ -379,11 +379,14 @@ def _generate_git_purl(d, download_location, srcrev):
>
>      for domain, purl_type in git_purl_handlers.items():
>          if hostname == domain:
> -            path = parsed.path.strip("/")
> +            # oe.spdx_common.fetch_data_to_uri() appends "@<rev>" to the
> +            # download location, which must not become part of the
> +            # repository name
> +            path = parsed.path.strip("/").partition("@")[0]
>              path_parts = path.split("/")
>              if len(path_parts) >= 2:
>                  owner = path_parts[0]
> -                repo = path_parts[1].replace(".git", "")
> +                repo = path_parts[1].removesuffix(".git")
>                  return f"{purl_type}/{owner}/{repo}@{srcrev}"
>              break
>
> --
> 2.34.1
>
>

[-- Attachment #2: Type: text/html, Size: 2904 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [OE-core] [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs
  2026-09-08 14:44 ` Joshua Watt
@ 2026-10-30  0:09   ` KAZUYOSHI AKIYAMA (秋山 和慶)
  2026-10-30  7:11     ` Mathieu Dubois-Briand
  0 siblings, 1 reply; 5+ messages in thread
From: KAZUYOSHI AKIYAMA (秋山 和慶) @ 2026-10-30  0:09 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org
  Cc: stondo@gmail.com, JPEWhacker@gmail.com, Paul Barker

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]

Hi,

A gentle ping on this patch.

Joshua reviewed it with "LGTM" and a Reviewed-by tag, but it still
appears to be waiting for merge.

Would it be possible to pick this up for master when you have a chance?

Thanks,
Kazuyoshi

From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Joshua Watt via lists.openembedded.org
Sent: Tuesday, September 8, 2026 11:44 PM
To: KAZUYOSHI AKIYAMA (秋山 和慶) <kazuyoshi_akiyama@jp.honda>
Cc: openembedded-core@lists.openembedded.org; stondo@gmail.com
Subject: Re: [OE-core] [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs



On Tue, Aug 25, 2026 at 4:44 AM KAZUYOSHI AKIYAMA (秋山 和慶) <kazuyoshi_akiyama@jp.honda<mailto:kazuyoshi_akiyama@jp.honda>> wrote:
_generate_git_purl() generates invalid PURLs of the form
`pkg:github/<owner>/<repo>@<rev>@<rev>`.
purl-spec only allows a single `@<rev>`.

oe.spdx_common.fetch_data_to_uri() already appends "@<rev>" to the
download location, and urlparse() leaves that suffix in parsed.path.
Therefore, the parsed repository name(`{repo}`) includes `@<rev>`.
So, need to strip the revision suffix before splitting out
the owner(`{owner}`) and the repository name(`{repo}`).

While here, replace str.replace(".git", "") with str.removesuffix() so
repository names that contain ".git" elsewhere are preserved.

Signed-off-by: Kazuyoshi Akiyama <kazuyoshi_akiyama@jp.honda<mailto:kazuyoshi_akiyama@jp.honda>>

LGTM, thank.

Reviewed-by: Joshua Watt <JPEWhacker@gmail.com<mailto:JPEWhacker@gmail.com>>


---
 meta/lib/oe/spdx30_tasks.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index dac02e3784..b2f208e1f6 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -379,11 +379,14 @@ def _generate_git_purl(d, download_location, srcrev):

     for domain, purl_type in git_purl_handlers.items():
         if hostname == domain:
-            path = parsed.path.strip("/")
+            # oe.spdx_common.fetch_data_to_uri() appends "@<rev>" to the
+            # download location, which must not become part of the
+            # repository name
+            path = parsed.path.strip("/").partition("@")[0]
             path_parts = path.split("/")
             if len(path_parts) >= 2:
                 owner = path_parts[0]
-                repo = path_parts[1].replace(".git", "")
+                repo = path_parts[1].removesuffix(".git")
                 return f"{purl_type}/{owner}/{repo}@{srcrev}"
             break

--
2.34.1

[-- Attachment #2: Type: text/html, Size: 8638 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs
  2026-10-30  0:09   ` [OE-core] " KAZUYOSHI AKIYAMA (秋山 和慶)
@ 2026-10-30  7:11     ` Mathieu Dubois-Briand
  2026-10-30  7:14       ` KAZUYOSHI AKIYAMA (秋山 和慶)
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-10-30  7:11 UTC (permalink / raw)
  To: kazuyoshi_akiyama, openembedded-core@lists.openembedded.org
  Cc: stondo@gmail.com, JPEWhacker@gmail.com, Paul Barker

On Fri Oct 30, 2026 at 1:09 AM CET, KAZUYOSHI AKIYAMA via openembedded-core wrote:
> Hi,
>
> A gentle ping on this patch.
>
> Joshua reviewed it with "LGTM" and a Reviewed-by tag, but it still
> appears to be waiting for merge.
>
> Would it be possible to pick this up for master when you have a chance?
>

Hi,

I believe your patch already landed into master:
https://git.openembedded.org/openembedded-core/commit/?id=e31479ddbaf5

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [OE-core] [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs
  2026-10-30  7:11     ` Mathieu Dubois-Briand
@ 2026-10-30  7:14       ` KAZUYOSHI AKIYAMA (秋山 和慶)
  0 siblings, 0 replies; 5+ messages in thread
From: KAZUYOSHI AKIYAMA (秋山 和慶) @ 2026-10-30  7:14 UTC (permalink / raw)
  To: mathieu.dubois-briand@bootlin.com,
	openembedded-core@lists.openembedded.org

Hi, Mathieu

Thank you for the reply and merging.
Since the status of Patchwork has not changed, I misunderstood.

Best Regard,
Kazuyoshi Akiyama

-----Original Message-----
From: Mathieu Dubois-Briand via openembedded-core <mathieu.dubois-briand=bootlin.com@lists.openembedded.org> 
Sent: Friday, October 30, 2026 4:12 PM
To: KAZUYOSHI AKIYAMA (秋山 和慶) <kazuyoshi_akiyama@jp.honda>; openembedded-core@lists.openembedded.org
Cc: stondo@gmail.com; JPEWhacker@gmail.com; Paul Barker <paul@pbarker.dev>
Subject: Re: [OE-core] [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs

On Fri Oct 30, 2026 at 1:09 AM CET, KAZUYOSHI AKIYAMA via openembedded-core wrote:
> Hi,
>
> A gentle ping on this patch.
>
> Joshua reviewed it with "LGTM" and a Reviewed-by tag, but it still 
> appears to be waiting for merge.
>
> Would it be possible to pick this up for master when you have a chance?
>

Hi,

I believe your patch already landed into master:
https://urldefense.com/v3/__https://git.openembedded.org/openembedded-core/commit/?id=e31479ddbaf5__;!!KEiQlu1B30Bt!x7walIuKfNZVg01QffJoPNLPyqaymrIhIKl-DuhLvZ6gReaiVyG9DTFNXPIaO4VqdXkQhxKRwn85M6QKoX0Drci2XcHvdN9zTVa2ZVq9hRQm7cg$ 

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://urldefense.com/v3/__https://bootlin.com__;!!KEiQlu1B30Bt!x7walIuKfNZVg01QffJoPNLPyqaymrIhIKl-DuhLvZ6gReaiVyG9DTFNXPIaO4VqdXkQhxKRwn85M6QKoX0Drci2XcHvdN9zTVa2ZVq9uNHZ-sE$ 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-30  7:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 10:44 [PATCH] spdx30_tasks: Fix duplicated revision in Git PURLs KAZUYOSHI AKIYAMA (秋山 和慶)
2026-09-08 14:44 ` Joshua Watt
2026-10-30  0:09   ` [OE-core] " KAZUYOSHI AKIYAMA (秋山 和慶)
2026-10-30  7:11     ` Mathieu Dubois-Briand
2026-10-30  7:14       ` KAZUYOSHI AKIYAMA (秋山 和慶)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox