diff options
author | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-25 18:27:27 +0000 |
---|---|---|
committer | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2012-06-25 18:27:27 +0000 |
commit | a4fb3997ba6dad842934b08400e12f065e4a733c (patch) | |
tree | 7dddf509306b31e13b2b44955200c04c799d405d | |
parent | 2c8e250093d20e5ab658f9de81a1ad9c98a47014 (diff) | |
download | perl-RPM4-a4fb3997ba6dad842934b08400e12f065e4a733c.tar perl-RPM4-a4fb3997ba6dad842934b08400e12f065e4a733c.tar.gz perl-RPM4-a4fb3997ba6dad842934b08400e12f065e4a733c.tar.bz2 perl-RPM4-a4fb3997ba6dad842934b08400e12f065e4a733c.tar.xz perl-RPM4-a4fb3997ba6dad842934b08400e12f065e4a733c.zip |
(_newspec,newspec) drop unused 'cookie', 'passphrase', 'rootdir' & 'verify' parameters
(useless with rpm-4.9.x anyway)
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@217 971eb68f-4bfb-0310-8326-d2484c010a4c
-rw-r--r-- | RPM4/NEWS | 1 | ||||
-rw-r--r-- | RPM4/src/RPM4.xs | 45 | ||||
-rw-r--r-- | RPM4/t/04spec.t | 4 |
3 files changed, 7 insertions, 43 deletions
@@ -1,5 +1,6 @@ - new spec: o fix forcing 'noarch_check' & 'force' parameters + o drop unused 'cookie', 'passphrase', 'rootdir' & 'verify' parameters (useless with rpm-4.9.x anyway) Version 0.30 - 15 June 2012 diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index f8ade44..520e246 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -396,36 +396,18 @@ void _newdep(SV * sv_deptag, char * name, SV * sv_sense, SV * sv_evr) { } /* Get a new specfile */ -void _newspec(rpmts ts, char * filename, SV * svpassphrase, SV * svrootdir, SV * svcookies, SV * svanyarch, SV * svforce, SV * svverify) { +void _newspec(rpmts ts, char * filename, SV * svanyarch, SV * svforce) { rpmSpec spec = NULL; - char * passphrase = NULL; - char * rootdir = NULL; - char * cookies = NULL; int anyarch = 0; int force = 0; - int verify = 0; dSP; - if (svpassphrase && SvOK(svpassphrase)) - passphrase = SvPV_nolen(svpassphrase); - - if (svrootdir && SvOK(svrootdir)) - rootdir = SvPV_nolen(svrootdir); - else - rootdir = "/"; - - if (svcookies && SvOK(svcookies)) - cookies = SvPV_nolen(svcookies); - if (svanyarch && SvOK(svanyarch)) anyarch = SvIV(svanyarch); if (svforce && SvOK(svforce)) force = SvIV(svforce); - if (svverify && SvOK(svverify)) - verify = SvIV(svverify); - if (filename) { #ifdef RPM4_9_0 rpmSpecFlags flags = 0; @@ -435,7 +417,7 @@ void _newspec(rpmts ts, char * filename, SV * svpassphrase, SV * svrootdir, SV * flags |= RPMSPEC_FORCE; spec = rpmSpecParse(filename, flags, NULL); #else - if (!parseSpec(ts, filename, rootdir, NULL ,0, passphrase, cookies, anyarch, force)) + if (!parseSpec(ts, filename, "/", NULL ,0, NULL, NULL, anyarch, force)) spec = rpmtsSetSpec(ts, NULL); #endif #ifdef HHACK @@ -2602,19 +2584,15 @@ Files_nlink(Files) MODULE = RPM4 PACKAGE = RPM4 void -newspec(filename = NULL, passphrase = NULL, rootdir = NULL, cookies = NULL, anyarch = NULL, force = NULL, verify = NULL) +newspec(filename = NULL, anyarch = NULL, force = NULL) char * filename - SV * passphrase - SV * rootdir - SV * cookies SV * anyarch SV * force - SV * verify PREINIT: rpmts ts = rpmtsCreate(); PPCODE: PUTBACK; - _newspec(ts, filename, passphrase, rootdir, cookies, anyarch, force, verify); + _newspec(ts, filename, anyarch, force); ts = rpmtsFree(ts); SPAGAIN; @@ -2626,12 +2604,8 @@ Spec_new(perlclass, specfile = NULL, ...) char * specfile PREINIT: rpmts ts = NULL; - SV * passphrase = NULL; - SV * rootdir = NULL; - SV * cookies = NULL; SV * anyarch = 0; SV * force = 0; - SV * verify = 0; int i; PPCODE: for(i=2; i < items; i++) { @@ -2651,18 +2625,9 @@ Spec_new(perlclass, specfile = NULL, ...) } else if (strcmp(SvPV_nolen(ST(i)), "force") == 0) { i++; force = ST(i); - } else if (strcmp(SvPV_nolen(ST(i)), "verify") == 0) { - i++; - verify = ST(i); } else if (strcmp(SvPV_nolen(ST(i)), "anyarch") == 0) { i++; anyarch = ST(i); - } else if (strcmp(SvPV_nolen(ST(i)), "passphrase") == 0) { - i++; - passphrase = ST(i); - } else if (strcmp(SvPV_nolen(ST(i)), "root") == 0) { - i++; - rootdir = ST(i); } else { warn("Unknown value in " bless_spec "->new, ignored"); i++; @@ -2671,7 +2636,7 @@ Spec_new(perlclass, specfile = NULL, ...) if (!ts) ts = rpmtsCreate(); PUTBACK; - _newspec(ts, specfile, passphrase, rootdir, cookies, anyarch, force, verify); + _newspec(ts, specfile, anyarch, force); SPAGAIN; ts = rpmtsFree(ts); diff --git a/RPM4/t/04spec.t b/RPM4/t/04spec.t index 74b9e21..1ffccf7 100644 --- a/RPM4/t/04spec.t +++ b/RPM4/t/04spec.t @@ -11,8 +11,6 @@ my %info = RPM4::moduleinfo(); my $testdir = tempdir( CLEANUP => 1 ); mkdir("$testdir/$_") foreach (qw(BUILD RPMS RPMS/noarch SRPMS)); -my $passphrase = "RPM4"; - RPM4::add_macro("_tmppath $testdir"); RPM4::add_macro("_builddir $testdir"); RPM4::add_macro("_topdir $testdir"); @@ -31,7 +29,7 @@ if ($info{Hack} eq "Yes") { ok(! defined(RPM4::Spec->new()), "Create an empty spec object don't works"); } ok(!defined($spec = RPM4::Spec->new("$Bin/test-rpm-1.0-1mdk.noarch.rpm")), "Loading a bad spec file"); -ok($spec = RPM4::Spec->new("$Bin/test-rpm.spec", passphrase => $passphrase), "Loading a spec file"); +ok($spec = RPM4::Spec->new("$Bin/test-rpm.spec"), "Loading a spec file"); my @rpms = $spec->binrpm; ok(@rpms == 1, "Can find binary package"); |