aboutsummaryrefslogtreecommitdiffstats
path: root/BCD/Resign.pm
diff options
context:
space:
mode:
Diffstat (limited to 'BCD/Resign.pm')
-rw-r--r--BCD/Resign.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/BCD/Resign.pm b/BCD/Resign.pm
index 4a0e02c..b6cc001 100644
--- a/BCD/Resign.pm
+++ b/BCD/Resign.pm
@@ -1,4 +1,4 @@
-package Resign;
+package BCD::Resign;
use strict;
use Parallel::ForkManager;
@@ -6,31 +6,38 @@ use File::Glob ':glob';
use File::Basename;
use Expect;
-use BCD::Common qw(:DEFAULT $isoconf $NB_FORK $rpmrc $pwd_file);
+use BCD::Common qw(:DEFAULT $isoconf $NB_FORK $rpmrc $pwd_file $builddir);
our @ISA = qw(Exporter);
our @EXPORT = qw(resign_media);
my $verbose;
my $LOG="MEDIA -";
-my $color = "purple";
+my $color = "yellow";
-my $password = `cat $pwd_file`;
-my $verbose = "0" ;
+my $password;
+if (defined $pwd_file) {
+ -f $pwd_file and $password = `cat $pwd_file`;
+}
sub print_info {
+ map { if (!-f $pwd_file) { print_color("$LOG I cant find $_ file, i cant sign packages...", $color); } } $rpmrc, $pwd_file;
print_color("$LOG i will resign using info in those files: $rpmrc $pwd_file", $color);
}
sub resign_media {
print_info();
my $pm = new Parallel::ForkManager($NB_FORK);
- my @list_path;
+ my @list_path; my @checked; my $already_done;
foreach my $media (@{$isoconf->{media}{list}}) {
+ foreach (@checked) { $_ or next ; $media->{destmedia} =~ /^$_$/ and $already_done = 1; };
+ $already_done and next;
+ push @checked, $media->{destmedia};
push @list_path, $media->{destmedia};
+ print_color("$LOG resigning packages from $media->{destmedia} media", $color);
}
foreach (@list_path) {
- my @list_pkg = glob("$_/*.rpm");
+ my @list_pkg = glob("$builddir/media/$_/*.rpm");
my $count = @list_pkg;
print_color("$count transactions to do ... be patient !!!!", $color);
my $status = "0";