diff --git a/macros.perl b/macros.perl index 77cc30cce8eff5268d331317de2168be0768b9b4..3808adef7e7152db35499eac72eafb331e267348 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 8ea54d29c06d2646f20b051d7663d819ab4e2f68..ce92edfc1c80ddb6afa575c84caf218755ce3bd9 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