From 66a9528d21e406ef828a028f9f528a816fa2a0a9 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sat, 1 Nov 2025 23:33:43 +0800 Subject: [PATCH] fix name manipulation when cpan_source parameter given --- macros.perl | 13 ++++++++----- openEuler-rpm-config.spec | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/macros.perl b/macros.perl index 77cc30c..3808ade 100644 --- a/macros.perl +++ b/macros.perl @@ -179,8 +179,8 @@ This package provides the test suite for package %{name}.\ # Expands to the cpanhosted URL for a package # Accepts zero to three arguments: # 1: The CPAN project name, defaulting to %%srcname if it is defined, then -# %%cpan_name if it is defined, then just %%name with "perl-" prefix -# removed. +# %%mod_name if it is defined, then just try %%cpan_name, and %%name with +# "perl-" prefix removed. # 2: The MetaCPAN project version, defaulting to %%version. # 3: The file extension, defaulting to "tar.gz". (A period will be added # automatically.) @@ -196,7 +196,7 @@ This package provides the test suite for package %{name}.\ %__cpan_default_extension tar.gz %cpan_source() %{lua: - local src = rpm.expand('%1') + local src = rpm.expand('%1'):gsub('^perl%-','') local ver = rpm.expand('%2') local ext = rpm.expand('%3') local url = rpm.expand('%__cpan_url') @@ -207,14 +207,17 @@ This package provides the test suite for package %{name}.\ src = rpm.expand('%srcname') end if src == '%srcname' then + src = rpm.expand('%mod_name') + end + if src == '%mod_name' then src = rpm.expand('%cpan_name') end if src == '%cpan_name' then src = rpm.expand('%name'):gsub('^perl%-','') end local prefix - if string.match(src, '^(.+)%-') then - prefix = string.match(src, '^(.+)%-') + if string.match(src, '^([^-]+)%-') then + prefix = string.match(src, '^([^-]+)%-') else prefix = src end diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 8ea54d2..ce92edf 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 31 -Release: 40 +Release: 41 License: GPL+ AND MIT Summary: specific rpm configuration files URL: https://gitee.com/src-openeuler/openEuler-rpm-config @@ -213,6 +213,9 @@ sed -i "s|@OSCPE@|$(cat /etc/system-release-cpe)|" %{buildroot}%{rpmvdir}/%{vend %{rpmvdir}/find-requires.ksyms %changelog +* Sat Nov 01 2025 Funda Wang - 31-41 +- fix name manipulation when cpan_source parameter given + * Wed Oct 15 2025 Funda Wang - 31-40 - only display pkgconfig audit log when it is generated -- Gitee