From 519667d95a72d110e49c804aefa612c236cab722 Mon Sep 17 00:00:00 2001 From: nanardon Date: Tue, 27 Jun 2006 15:40:12 +0000 Subject: - clean up - can set passphrase into env var - add pod doc git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@112 971eb68f-4bfb-0310-8326-d2484c010a4c --- RPM4/bin/rpmresign | 92 ++++++++++++++++++++++++++++++++++++++++++++++++------ RPM4/src/RPM4.xs | 2 ++ 2 files changed, 85 insertions(+), 9 deletions(-) (limited to 'RPM4') diff --git a/RPM4/bin/rpmresign b/RPM4/bin/rpmresign index 7c860e1..c76c763 100755 --- a/RPM4/bin/rpmresign +++ b/RPM4/bin/rpmresign @@ -19,32 +19,78 @@ use warnings; use Getopt::Long; use RPM4::Sign; +use Pod::Usage; -my ($configfile, $batch, $sigtype, $passfile, $macrofile, $fastmode, $path, $name, $keyid, $pass); +my ($batch, $sigtype, $passfile, $macrofile, $fastmode, $path, $name, $keyid, $pass); my @defines; +=head1 NAME + +rpmresign + +=head1 DESCRIPTION + +Resign massively rpm file + +=head1 SYNOPSIS + +rpmresign [--passwordfile file] rpmfile or directory + +=cut + GetOptions( 'p|path=s' => \$path, 'n|name=s' => \$name, - 'c|config=s' => \$configfile, 'b|batch' => \$batch, 'd|define=s' => \@defines, 'f|fastmode' => \$fastmode, 'passwordfile|sig-pass-file=s' => \$passfile, 'm|macros=s' => \$macrofile, -); + 'help|h' => sub { pod2usage(0) }, +) or pod2usage(1); + +=head1 OPTIONS + +=over 8 + +=item B<--help> + +Print help + +=item B<--passwordfile> + +Read passphrase from this file + +=item B<--name> + +Use this name as gpg identity + +=item B<--macros> + +Load this macros file before processing + +=item B<--define> + +Define a rpm macro. This option is similar to --define of rpm. + +=item B<--path> + +Set gpghome to this directory + +=item B<-f> + +Fastmode: don't check rpm md5sum signatures before processing + +=back + +=cut foreach (@defines) { RPM4::add_macro($_); } -if (!$passfile) { - $pass = ; - chomp($pass); -} - my $sign = RPM4::Sign->new( - passphrase => $pass, + passphrase => $ENV{RPMRESIGN_PASSPHRASE}, _signature => $sigtype, path => $path, name => $name, @@ -63,3 +109,31 @@ while (my $f = shift(@ARGV)) { } $sign->rpmssign(@files); + +__END__ + +=head1 DESCRIPTION + +rpmresign is a perl script to massivelly resign rpms. Only rpm which does +not have the proper signature are resigned. + +The script will resign all rpms given on the command line or all rpms inside +directories (rpms are find with a glob on *.rpm). + +The passphrase can be passed from a file B<--passwordfile> or by setting the +envirronement variable B + +=head1 AUTHOR + +Olivier Thauvin + +=head1 SEE ALSO + +B perl module +http://rpm4.zarb.org/ + +=head1 LICENSE + +Gnu Public License version 2 or later. + +=cut diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 8e76c66..165a956 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -276,6 +276,7 @@ void * XPUSHs(sv_2mortal(newSVpv("total", 0))); XPUSHs(sv_2mortal(newSViv(total))); PUTBACK; + fprintf(stderr, "%x\n", data); call_sv((SV *) data, G_DISCARD | G_SCALAR); SPAGAIN; @@ -1857,6 +1858,7 @@ Ts_transrun(ts, callback, ...) rpmShowProgress, (void *) ((long) INSTALL_LABEL | INSTALL_HASH | INSTALL_UPGRADE)); } else if (SvTYPE(SvRV(callback)) == SVt_PVCV) { /* ref sub */ + fprintf(stderr, "%x\n", callback); rpmtsSetNotifyCallback(ts, transCallback, (void *) -- cgit v1.2.1