diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-04 16:43:03 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-04 16:43:03 +0000 |
commit | 35fa4dafd3ed825805c1ef1561ba81cb8983bc1b (patch) | |
tree | db06807f8e8b53d805252bf004db604e77856bfe | |
parent | 3d1a4c165264b3d9876fb84cca2ce6335c264b97 (diff) | |
download | perl-URPM-35fa4dafd3ed825805c1ef1561ba81cb8983bc1b.tar perl-URPM-35fa4dafd3ed825805c1ef1561ba81cb8983bc1b.tar.gz perl-URPM-35fa4dafd3ed825805c1ef1561ba81cb8983bc1b.tar.bz2 perl-URPM-35fa4dafd3ed825805c1ef1561ba81cb8983bc1b.tar.xz perl-URPM-35fa4dafd3ed825805c1ef1561ba81cb8983bc1b.zip |
- add osscore() and archscore() function to evaluate computer compatiblity to an arbitrary value
-rw-r--r-- | URPM.xs | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -3671,9 +3671,44 @@ Urpm_import_pubkey(...) RETVAL int +Urpm_archscore(arch) + const char * arch + PREINIT: + char * platform = NULL; + CODE: + read_config_files(0); +#ifdef RPM_448 + platform = rpmExpand(arch, "-%{_real_vendor}-%{_target_os}%{?_gnu}", NULL); + RETVAL=rpmPlatformScore(platform, NULL, 0); + _free(platform); +#else + RETVAL=rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); +#endif + OUTPUT: + RETVAL + +int +Urpm_osscore(os) + const char * os + PREINIT: + char * platform = NULL; + CODE: + read_config_files(0); +#ifdef RPM_448 + platform = rpmExpand("%{_real_arch}-%{_real_vendor}-", os, "%{?_gnu}", NULL); + RETVAL=rpmPlatformScore(platform, NULL, 0); + _free(platform); +#else + RETVAL=rpmMachineScore(RPM_MACHTABLE_INSTOS, os); +#endif + OUTPUT: + RETVAL + +int Urpm_platformscore(platform) const char * platform CODE: + read_config_files(0); #ifdef RPM_448 RETVAL=rpmPlatformScore(platform, NULL, 0); #else |