aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-04 12:06:25 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-04 12:06:25 +0000
commit4a0ef46b3098fedefed01d4a0a402d49215b6b01 (patch)
tree766150eb4f42224df5d67aae65fa34ce9044fedf
parent451f7af2bd785503c33a244cd37a22ca8e52ff03 (diff)
downloadperl-URPM-4a0ef46b3098fedefed01d4a0a402d49215b6b01.tar
perl-URPM-4a0ef46b3098fedefed01d4a0a402d49215b6b01.tar.gz
perl-URPM-4a0ef46b3098fedefed01d4a0a402d49215b6b01.tar.bz2
perl-URPM-4a0ef46b3098fedefed01d4a0a402d49215b6b01.tar.xz
perl-URPM-4a0ef46b3098fedefed01d4a0a402d49215b6b01.zip
fix proper return of 'src' as arch for src.rpms
-rw-r--r--NEWS1
-rw-r--r--URPM.xs33
2 files changed, 23 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 5eccea3..23a531f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
Version 4.27 - 4 May 2011, by Per Øyvind Karlsen
+- fix proper return of 'src' as arch for src.rpms
- fix confusion between %{sourcerpm} & %{sourcepackage} tags
Version 4.26 - 3 May 2011, by Per Øyvind Karlsen
diff --git a/URPM.xs b/URPM.xs
index 37c170f..10b63e7 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2043,8 +2043,12 @@ Pkg_arch(pkg)
get_fullname_parts(pkg, NULL, NULL, NULL, NULL, NULL, NULL, &arch, NULL);
XPUSHs(sv_2mortal(newSVpv(arch ? arch : "", 0)));
restore_chars();
- } else if (pkg->h)
- push_name(pkg, RPMTAG_ARCH);
+ } else if (pkg->h) {
+ if (headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) {
+ push_name(pkg, RPMTAG_ARCH);
+ } else
+ XPUSHs(sv_2mortal(newSVpvs("src")));
+ }
int
Pkg_is_arch_compat__XS(pkg)
@@ -2057,16 +2061,23 @@ Pkg_is_arch_compat__XS(pkg)
char *arch;
get_fullname_parts(pkg, NULL, NULL, NULL, NULL, NULL, NULL, &arch, NULL);
- platform = rpmExpand(arch, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
- RETVAL = rpmPlatformScore(platform, NULL, 0);
- _free(platform);
+ if (!strcmp(arch, "src"))
+ RETVAL = 1;
+ else {
+ platform = rpmExpand(arch, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
+ RETVAL = rpmPlatformScore(platform, NULL, 0);
+ _free(platform);
+ }
restore_chars();
- } else if (pkg->h && headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) {
- const char *arch = get_name(pkg->h, RPMTAG_ARCH);
- platform = rpmExpand(arch ? arch : "", "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
- RETVAL = rpmPlatformScore(platform, NULL, 0);
- _free(arch);
- _free(platform);
+ } else if (pkg->h) {
+ if (headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) {
+ const char *arch = get_name(pkg->h, RPMTAG_ARCH);
+ platform = rpmExpand(arch ? arch : "", "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
+ RETVAL = rpmPlatformScore(platform, NULL, 0);
+ _free(arch);
+ _free(platform);
+ } else
+ RETVAL = 1;
} else
RETVAL = 0;
OUTPUT: