aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: