diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2007-06-19 14:44:21 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2007-06-19 14:44:21 +0000 |
commit | 92e441cb3795aa5b8555f999911017817a6d2277 (patch) | |
tree | f29b0b811a1c34dffad7cc1c02ad9aa70b057d2d /URPM.xs | |
parent | d56ee13624590129c49ed2424c1ee2814837e560 (diff) | |
download | perl-URPM-92e441cb3795aa5b8555f999911017817a6d2277.tar perl-URPM-92e441cb3795aa5b8555f999911017817a6d2277.tar.gz perl-URPM-92e441cb3795aa5b8555f999911017817a6d2277.tar.bz2 perl-URPM-92e441cb3795aa5b8555f999911017817a6d2277.tar.xz perl-URPM-92e441cb3795aa5b8555f999911017817a6d2277.zip |
- make is_arch_compat rpm 4.4.8 compliant
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1334,7 +1334,10 @@ Pkg_arch(pkg) int Pkg_is_arch_compat(pkg) URPM::Package pkg + INIT: + char * platform; CODE: + char * arch; read_config_files(0); if (pkg->info) { char *arch; @@ -1342,11 +1345,22 @@ Pkg_is_arch_compat(pkg) get_fullname_parts(pkg, NULL, NULL, NULL, &arch, &eos); *eos = 0; - RETVAL = strcmp(arch, "noarch") == 0 ? 4 : rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); +#ifdef RPM_448 + platform = rpmExpand(arch, "-%{_real_vendor}-%{_target_os}%{?_gnu}", NULL); + RETVAL = rpmPlatformScore(platform, NULL, 0); +#else + RETVAL = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); +#endif *eos = '@'; + free(platform); } else if (pkg->h && headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) { char *arch = get_name(pkg->h, RPMTAG_ARCH); - RETVAL = strcmp(arch, "noarch") == 0 ? 4 : rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); +#ifdef RPM_448 + platform = rpmExpand(arch, "-%{_real_vendor}-%{_target_os}%{?_gnu}", NULL); + RETVAL = rpmPlatformScore(platform, NULL, 0); +#else + RETVAL = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); +#endif } else { RETVAL = 0; } |