diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-04 12:06:25 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-04 12:06:25 +0000 |
commit | 4a0ef46b3098fedefed01d4a0a402d49215b6b01 (patch) | |
tree | 766150eb4f42224df5d67aae65fa34ce9044fedf | |
parent | 451f7af2bd785503c33a244cd37a22ca8e52ff03 (diff) | |
download | perl-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-- | NEWS | 1 | ||||
-rw-r--r-- | URPM.xs | 33 |
2 files changed, 23 insertions, 11 deletions
@@ -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 @@ -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: |