diff options
Diffstat (limited to 'RPM4')
-rw-r--r-- | RPM4/src/RPM4.xs | 14 | ||||
-rwxr-xr-x | RPM4/t/03rpmlib.t | 8 |
2 files changed, 21 insertions, 1 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index beefdc0..ca5a672 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -791,6 +791,20 @@ archscore(arch, build = 0) OUTPUT: RETVAL +int +platformscore(platform) + const char * platform + PREINIT: + CODE: +#ifdef RPM4_4_8 + RETVAL=rpmPlatformScore(platform, NULL, 0); +#else + RETVAL=0; + croak("platformscore exists only from rpm 4.4.8"); +#endif + OUTPUT: + RETVAL + void buildhost() PPCODE: diff --git a/RPM4/t/03rpmlib.t b/RPM4/t/03rpmlib.t index c462768..996bfce 100755 --- a/RPM4/t/03rpmlib.t +++ b/RPM4/t/03rpmlib.t @@ -1,7 +1,7 @@ # $Id$ use strict; -use Test::More tests => 52; +use Test::More tests => 53; use FindBin qw($Bin); use RPM4; @@ -27,6 +27,12 @@ close($null); ok(length(RPM4::getosname), "Return OS name"); ok(length(RPM4::getarchname), "Return arch name"); ok(length(RPM4::buildhost), "Return buildhost"); +SKIP: { + eval { RPM4::platformscore(""); }; + skip "no RPM4::platformscore()", 1 if($@); + +ok(RPM4::platformscore("any-any-nonos") == 0, "can evaluate platform score"); +} # Playing with macros my $target_cpu = RPM4::expand("%_target_cpu"); |