aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-07-04 16:43:03 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-07-04 16:43:03 +0000
commit35fa4dafd3ed825805c1ef1561ba81cb8983bc1b (patch)
treedb06807f8e8b53d805252bf004db604e77856bfe /URPM.xs
parent3d1a4c165264b3d9876fb84cca2ce6335c264b97 (diff)
downloadperl-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
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs35
1 files changed, 35 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index 31047f6..6633c7b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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