diff options
author | Antoine Ginies <aginies@mandriva.com> | 2010-10-06 07:58:18 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2010-10-06 07:58:18 +0000 |
commit | b364785ea90e60806aaaec56d15bcc70a74daf6d (patch) | |
tree | da257e1277bd0218929f12fde2e318657067eb16 /resign_rpm_by_path.pl | |
parent | 46324a3fd9b86040b16dc3070b3a22438f7a616d (diff) | |
download | bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.gz bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.bz2 bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.xz bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.zip |
end of the move
Diffstat (limited to 'resign_rpm_by_path.pl')
-rwxr-xr-x | resign_rpm_by_path.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/resign_rpm_by_path.pl b/resign_rpm_by_path.pl new file mode 100755 index 0000000..3807a3e --- /dev/null +++ b/resign_rpm_by_path.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl -w + +use strict; +use Parallel::ForkManager; +use File::Glob ':glob'; +use File::Basename; +use Expect; + + +my $NB_FORK=15; +# password file +my $pwd_file = "/home/plop/.signature.gpg"; +my $rpmrc = "/home/plop/.rpmrc"; +my $path = $ARGV[0]; + +$ARGV[0] or die "First arg must be a path to rpm\n"; + +my $password = `cat $pwd_file`; +my $verbose = "0" ; + +my $pm = new Parallel::ForkManager($NB_FORK); +my @list_pkg = glob("$path/*.rpm"); +my $count = @list_pkg; +print "$count transactions to do ... be patient !!!!"; +my $status = "0"; +foreach my $pkg (@list_pkg) { + $pkg or next; + my $basename_pkg = basename($pkg); + $status++; + my $pid = $pm->start and next; + print("$basename_pkg ($status/$count)\n"); + my $command = Expect->spawn("LC_ALL=C rpm --rcfile=$rpmrc --resign $pkg") or die "Couldn't start rpm: $!\n"; + $command->log_stdout($verbose); + $command->expect(20, -re, 'Enter pass phrase:' => sub { print $command $password; }); + $command->expect(undef); + $command->soft_close(); + $pm->finish; +} +print "Waiting for the end of some signature...\n"; +$pm->wait_all_children; +print "all signature are done...\n"; |