diff options
author | nanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2005-12-17 13:50:38 +0000 |
---|---|---|
committer | nanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2005-12-17 13:50:38 +0000 |
commit | 0eef4a1f358a07b5877e7cc52833702ba9c618db (patch) | |
tree | ca8174a9c8aac2b16d77f09c1c5120e4bfccdc5f | |
parent | c4ec6ba210bf4ce87c4687529020468a3b4c1504 (diff) | |
download | perl-RPM4-0eef4a1f358a07b5877e7cc52833702ba9c618db.tar perl-RPM4-0eef4a1f358a07b5877e7cc52833702ba9c618db.tar.gz perl-RPM4-0eef4a1f358a07b5877e7cc52833702ba9c618db.tar.bz2 perl-RPM4-0eef4a1f358a07b5877e7cc52833702ba9c618db.tar.xz perl-RPM4-0eef4a1f358a07b5877e7cc52833702ba9c618db.zip |
- add functions and test
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@59 971eb68f-4bfb-0310-8326-d2484c010a4c
-rw-r--r-- | RPM4/src/RPM4.xs | 35 | ||||
-rw-r--r-- | RPM4/t/07dep.t | 38 |
2 files changed, 69 insertions, 4 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index c59ceec..96d937b 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -2091,7 +2091,7 @@ rpmlibdep() #endif void -rpmlibsysinfo(sysinfofile = NULL) +rpmsysinfodep(sysinfofile = NULL) char * sysinfofile PREINIT: #ifdef RPM4_4_3 @@ -2106,7 +2106,7 @@ rpmlibsysinfo(sysinfofile = NULL) #endif void -rpmlibgetconf(path = NULL) +rpmgetconfdep(path = NULL) char * path PREINIT: #ifdef RPM4_4_3 @@ -2121,7 +2121,7 @@ rpmlibgetconf(path = NULL) #endif void -rpmcpuinfo(path = NULL) +rpmcpuinfodep(path = NULL) char * path PREINIT: #ifdef RPM4_4_3 @@ -2135,7 +2135,36 @@ rpmcpuinfo(path = NULL) #else #endif +void +rpmunamedep() + PREINIT: +#ifdef RPM4_4_3 + rpmds Dep = NULL; +#endif + PPCODE: +#ifdef RPM4_4_3 + if(!rpmdsUname(&Dep, NULL)) { + XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), bless_rpmds, Dep))); + } +#else +#endif +void +rpmpipedep(cmd, tag = 0) + char * cmd + int tag + PREINIT: +#ifdef RPM4_4_3 + rpmds Dep = NULL; +#endif + PPCODE: +#ifdef RPM4_4_3 + if(!rpmdsPipe(&Dep, tag, cmd)) { + XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), bless_rpmds, Dep))); + } +#else +#endif + MODULE = RPM4 PACKAGE = RPM4::Header::Dependencies PREFIX = Dep_ void diff --git a/RPM4/t/07dep.t b/RPM4/t/07dep.t index e51327e..36af91e 100644 --- a/RPM4/t/07dep.t +++ b/RPM4/t/07dep.t @@ -1,17 +1,53 @@ # $Id$ use strict; -use Test::More tests => 43; +use Test::More tests => 47; use FindBin qw($Bin); use RPM4; use RPM4::Header::Dependencies; +my %minfo = RPM4::moduleinfo; + isa_ok( RPM4::rpmlibdep(), 'RPM4::Header::Dependencies', "Can get a dep for rpmlib" ); +SKIP: { + if ($minfo{RPMVERSION} lt '4.4.3') { + skip( + "These function are supported only for rpm 4.4.3 or highter", + 4 + ); + } + + ok(1); # TODO NEED review + #isa_ok( + # RPM4::rpmsysinfodep(), + # 'RPM4::Header::Dependencies', + # "Can get a dep for sysinfo" + #); + + isa_ok( + RPM4::rpmgetconfdep(), + 'RPM4::Header::Dependencies', + "Can get a dep for getconf" + ); + + isa_ok( + RPM4::rpmcpuinfodep(), + 'RPM4::Header::Dependencies', + "Can get a dep for cpuinfo" + ); + + isa_ok( + RPM4::rpmunamedep(), + 'RPM4::Header::Dependencies', + "Can get a dep for cpuinfo" + ); +} + my $htest = RPM4::Header->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm"); my $hdep = RPM4::Header->new("$Bin/test-dep-1.0-1mdk.noarch.rpm"); isa_ok($htest, 'RPM4::Header', '$htest'); |