summaryrefslogtreecommitdiffstats
path: root/RPM4
diff options
context:
space:
mode:
authornanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2006-06-27 15:40:12 +0000
committernanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2006-06-27 15:40:12 +0000
commit519667d95a72d110e49c804aefa612c236cab722 (patch)
tree9c366b3bc53faa54f862abe483aad5981d79f728 /RPM4
parent377d8da5a7cf555f0b60877397d42b5542b74eeb (diff)
downloadperl-RPM4-519667d95a72d110e49c804aefa612c236cab722.tar
perl-RPM4-519667d95a72d110e49c804aefa612c236cab722.tar.gz
perl-RPM4-519667d95a72d110e49c804aefa612c236cab722.tar.bz2
perl-RPM4-519667d95a72d110e49c804aefa612c236cab722.tar.xz
perl-RPM4-519667d95a72d110e49c804aefa612c236cab722.zip
- 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
Diffstat (limited to 'RPM4')
-rwxr-xr-xRPM4/bin/rpmresign92
-rw-r--r--RPM4/src/RPM4.xs2
2 files changed, 85 insertions, 9 deletions
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 = <STDIN>;
- 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<RPMRESIGN_PASSPHRASE>
+
+=head1 AUTHOR
+
+Olivier Thauvin <nanardon@zarb.org>
+
+=head1 SEE ALSO
+
+B<RPM4> 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 *)