diff mbox series

[RFC,1/2] utils/scancpan: generate PURL package variable

Message ID 20240407144250.7558-2-francois.perrad@gadz.org
State New
Headers show
Series PURL pkg:cpan | expand

Commit Message

Francois Perrad April 7, 2024, 2:42 p.m. UTC
follow https://github.com/giterlizzi/perl-URI-PackageURL
where the author is used as namespace

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 utils/scancpan | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/utils/scancpan b/utils/scancpan
index e7739a8ad..fbf17d0f9 100755
--- a/utils/scancpan
+++ b/utils/scancpan
@@ -754,6 +754,7 @@  while (my ($distname, $dist) = each %dist) {
     }
     if ($force || !-f $mkname) {
         my $version = $dist->{version};
+        my $author = $dist->{author};
         my ($path) = $dist->{download_url} =~ m|^[^:/?#]+://[^/?#]*([^?#]*)|;
         # this URL contains only the scheme, auth and path parts (but no query and fragment parts)
         # the scheme is not used, because the job is done by the BR download infrastructure
@@ -786,6 +787,7 @@  while (my ($distname, $dist) = each %dist) {
         say {$fh} qq{${brname}_VERSION = ${version}};
         say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
         say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
+        say {$fh} qq{${brname}_PURL = pkg:cpan/${author}/${distname}\@\$(${brname}_VERSION)};
         say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies;
         say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies;
         say {$fh} qq{${brname}_LICENSE = ${license}} if $license;