aboutsummaryrefslogtreecommitdiffstats
path: root/BCD
diff options
context:
space:
mode:
Diffstat (limited to 'BCD')
-rw-r--r--BCD/Bcd.pm5
-rw-r--r--BCD/Common.pm16
-rw-r--r--BCD/Genisoimage.pm4
-rw-r--r--BCD/Isolinux.pm8
-rw-r--r--BCD/Media.pm17
-rw-r--r--BCD/Resign.pm8
-rw-r--r--BCD/Stagex.pm2
-rw-r--r--BCD/Web.pm11
8 files changed, 29 insertions, 42 deletions
diff --git a/BCD/Bcd.pm b/BCD/Bcd.pm
index cc65737..37cd898 100644
--- a/BCD/Bcd.pm
+++ b/BCD/Bcd.pm
@@ -11,6 +11,7 @@ use BCD::Common qw(:DEFAULT $wd $isoconf $name $arch $version $isodir $builddir
use BCD::Genisoimage;
use BCD::Isolinux;
use BCD::Stagex;
+use BCD::CheckMedia;
use BCD::Media;
use BCD::Web;
@@ -48,6 +49,7 @@ sub show_info {
print "\n";
}
+
sub main_bcd() {
my %opts = (
'' => \&help_bcd,
@@ -63,8 +65,7 @@ sub main_bcd() {
list => \&list_media,
mediarepo => \&list_medias_available,
checkrepo => \&check_repo_hdlist,
- rpmcheck => \&rpmcheck_launch,
- smartcheck => \&smartcheck_launch,
+ check => \&check_launch,
doble => \&solve_doble_issue,
kernel => \&find_all_kernel,
resign => \&resign_media,
diff --git a/BCD/Common.pm b/BCD/Common.pm
index 9804eed..d0ab23a 100644
--- a/BCD/Common.pm
+++ b/BCD/Common.pm
@@ -11,7 +11,7 @@ use File::Glob ':glob';
use BCD::Bcd qw(:DEFAULT);
our @ISA = qw(Exporter);
-our @EXPORT = qw(create_needed_dir check_dir clean_all print_color check_based_on);
+our @EXPORT = qw(create_needed_dir check_dir clean_all print_color);
# export all needed var
our @EXPORT_OK = qw($isoconf $wd $name $arch $file $based_on $version $repo $isodir $builddir $distrib_path $error_color $DISTRIB $THEME $tmp_rpmsrate $NB_FORK $dir_deps @list_of_removed $rpmrc $pwd_file $conf_file $date $urpmqlogs $rpmcheck_list_pkg $file_rpmcheck_log $smartcheck_list_pkg $smartcheck_dir $file_smartcheck_log $chroot_path $support);
@@ -132,20 +132,6 @@ sub check_dir {
create_needed_dir("/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}");
}
-sub check_based_on {
- if ($isoconf->{based_on} eq "1" || $isoconf->{based_on} =~ "gauldron") {
- # dedicated line for MGA
- print_color("Mageia distribution", $color);
- return 1;
- } elsif ($isoconf->{based_on} gt "2009.1" || $isoconf->{based_on} ne "mes5") {
- print_color("distribution > 2009.1 or not a MES5", $color);
- return 1;
- } else {
- print_color("distribution < 2009.1 or MES5", $color);
- return 0;
- }
-}
-
sub clean_all {
my @l = glob("/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}/$distrib_path/*");
foreach (@l) {
diff --git a/BCD/Genisoimage.pm b/BCD/Genisoimage.pm
index 84546d7..bf2f797 100644
--- a/BCD/Genisoimage.pm
+++ b/BCD/Genisoimage.pm
@@ -61,7 +61,7 @@ sub create_idx {
foreach (@hdlists) {
print_color("$LOG parsing $_ hslist", $color);
$urpm->parse_hdlist($_);
- $urpm->traverse( sub {
+ $urpm->traverse(sub {
my $pkg = shift;
my $pkgname = $pkg->name;
my $version = $pkg->version;
@@ -122,7 +122,7 @@ sub create_md5 {
sub isohybrid {
print_color("$LOG isohybrid the ISO", $color);
my $ISOFILE = "$isodir/$isoname.iso";
-# system("isohybrid $iso->{options}{isohybrid} $ISOFILE") == 0 or die "$LOG system isohybrid failed: $?\n";
+ system("isohybrid $isoconf->{options}{isohybrid} $ISOFILE") == 0 or die "$LOG system isohybrid failed: $?\n";
}
sub copy_textfiles {
diff --git a/BCD/Isolinux.pm b/BCD/Isolinux.pm
index 0f17dd1..fa1ef50 100644
--- a/BCD/Isolinux.pm
+++ b/BCD/Isolinux.pm
@@ -50,15 +50,15 @@ sub add_entry {
sub use_firmware {
print_color("$LOG copy fw.gz to $build_isolinux_dir/alt0/", $color);
my $syslinuxcfg = "$build_isolinux_dir/isolinux.cfg";
- open (IN, "+<$syslinuxcfg");
+ open(IN, "+<$syslinuxcfg");
@file = <IN>;
seek IN,0,0;
- foreach (@file){
- $_ =~ s|alt0/all.rdz|alt0/all.rdz,alt0/fw.gz|g;
+ foreach (@file) {
+ s|alt0/all.rdz|alt0/all.rdz,alt0/fw.gz|g;
print IN $_;
}
close IN;
- system("cp -v /usr/lib*/drakx-installer-images/isolinux/alt0/fw.gz $build_isolinux_dir/alt0/")
+ system("cp -v /usr/lib*/drakx-installer-images/isolinux/alt0/fw.gz $build_isolinux_dir/alt0/");
}
sub copy_files {
diff --git a/BCD/Media.pm b/BCD/Media.pm
index b1b3937..7f6e7a2 100644
--- a/BCD/Media.pm
+++ b/BCD/Media.pm
@@ -44,7 +44,6 @@ sub show_size {
}
sub list_media {
- check_based_on;
print_color("$LOG all media are listed there:", $color);
foreach my $media (@{$isoconf->{media}{list}}) {
$media->{name} or next;
@@ -96,12 +95,12 @@ sub use_gendistrib {
print_color("$LOG gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir", $color);
my $cmd = "gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir";
system($cmd) == 0 or die "$LOG system $cmd failed: $?\n";
- if (check_based_on eq "0") {
+ if ($isoconf->{based_on} lt "2009.1" || $isoconf->{based_on} eq "mes5") {
foreach my $media (@{$isoconf->{media}{list}}) {
$media->{name} or next;
if ($destmedia eq $media->{destmedia}) { next }
$destmedia = $media->{destmedia};
- print_color("$LOG < 2009.1 or mes5 detected or not Mageia", $color);
+ print_color("$LOG < 2009.1 or mes5 detected", $color);
print_color("$LOG move hdlists and synthesys from $builddir/media/$destmedia/media_info to $builddir/media/media_info/", $color);
system("rm -vf $builddir/media/media_info/*_$media->{name}.cz");
# system("rm -vf $builddir/media/media_info/*_main.cz");
@@ -129,7 +128,8 @@ sub create_mediacfg {
print $MEDIACFG "\n";
print $MEDIACFG "[media_info]\n";
print $MEDIACFG "version=$version\n";
- if (check_based_on eq "1") {
+ if ($isoconf->{based_on} gt "2009.1" && $isoconf->{based_on} ne "mes5") {
+ print_color("$LOG > 2009.1 or not a mes5 product", $color);
print $MEDIACFG "mediacfg_version=2\n";
}
print $MEDIACFG "branch=$isoconf->{iso}{branch}\n";
@@ -150,14 +150,15 @@ sub create_mediacfg {
$media->{name} or next;
if ($destmedia eq $media->{destmedia}) { next }
$destmedia = $media->{destmedia};
- if (check_based_on eq "0") {
+ if ($isoconf->{based_on} =~ "mes5" || $isoconf->{based_on} lt "2009.1") {
+ print_color("$LOG < 2009.1 or mes5 detected", $color);
print $MEDIACFG "
[$media->{destmedia}]
hdlist=hdlist_$media->{name}.cz
pubkey=pubkey_$media->{name}
-name=$media->{name}
-desc=$media->{desc}
+name=$isoconf->{iso}{header}{volumesetid}
+desc=$isoconf->{iso}{header}{volumesetid}
\n";
} else {
print $MEDIACFG "
@@ -838,7 +839,7 @@ sub use_genhdlist2 {
sub remove_hdlist {
my $destmedia;
- if (check_based_on eq "1") {
+ if ($isoconf->{based_on} gt "2009.1" or $isoconf->{based_on} != "mes5") {
print_color("$LOG remove hdlists*.cz from $builddir/media/media_info", $color);
system("rm -vf $builddir/media/media_info/hdlist*.cz");
foreach my $media (@{$isoconf->{media}{list}}) {
diff --git a/BCD/Resign.pm b/BCD/Resign.pm
index b6cc001..2dc9e94 100644
--- a/BCD/Resign.pm
+++ b/BCD/Resign.pm
@@ -21,7 +21,7 @@ if (defined $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;
+ 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);
}
@@ -30,7 +30,7 @@ sub resign_media {
my $pm = new Parallel::ForkManager($NB_FORK);
my @list_path; my @checked; my $already_done;
foreach my $media (@{$isoconf->{media}{list}}) {
- foreach (@checked) { $_ or next ; $media->{destmedia} =~ /^$_$/ and $already_done = 1; };
+ foreach (@checked) { $_ or next; $media->{destmedia} =~ /^$_$/ and $already_done = 1 }
$already_done and next;
push @checked, $media->{destmedia};
push @list_path, $media->{destmedia};
@@ -49,9 +49,9 @@ sub resign_media {
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(20, '-re', 'Enter pass phrase:' => sub { print $command $password });
$command->expect(undef);
- $command->soft_close();
+ $command->soft_close;
$pm->finish;
}
print_color("Waiting for the end of some signature...", $color);
diff --git a/BCD/Stagex.pm b/BCD/Stagex.pm
index ed9bd2d..7b6d2fb 100644
--- a/BCD/Stagex.pm
+++ b/BCD/Stagex.pm
@@ -63,7 +63,7 @@ sub copy_misc {
if (-d "$repo/$based_on/$arch/misc") {
system("rm -rf $builddir/misc && mkdir $builddir/misc");
system("cp -a $repo/$based_on/$arch/misc/drakx-in-chroot $builddir/misc/");
- system("cp -a $repo/$based_on/$arch/misc/mdkinst_stage2_tooldosutils $builddir/misc/");
+ system("cp -a $repo/$based_on/$arch/misc/mdkinst_stage2_tool $builddir/misc/");
} else {
print_color("$LOG FAILED copy of misc directory from $repo/$based_on/$arch", $error_color);
}
diff --git a/BCD/Web.pm b/BCD/Web.pm
index 70cf501..7d1436b 100644
--- a/BCD/Web.pm
+++ b/BCD/Web.pm
@@ -1,13 +1,12 @@
package BCD::Web;
use strict;
-use BCD::Media qw($rpmcheck_list_pkg $file_rpmcheck_log);
use BCD::Genisoimage qw($isoname);
use URPM;
use File::Slurp;
use MDK::Common;
-use BCD::Common qw(:DEFAULT $isoconf $isodir $wd $arch $version $based_on $repo $THEME $name $conf_file $date $urpmqlogs);
+use BCD::Common qw(:DEFAULT $isoconf $isodir $wd $arch $version $based_on $repo $THEME $name $conf_file $date $urpmqlogs $rpmcheck_list_pkg $file_rpmcheck_log $smartcheck_list_pkg $file_smartcheck_log);
our @ISA = qw(Exporter);
our @EXPORT = qw(main_html);
@@ -20,7 +19,7 @@ my $index = $isoconf->{nameid} . '-' . $isoconf->{mediainfo}{version} . '-' . $i
my $public_html = "~/public_html";
my $webdir = "$public_html/$isoname-$date";
-map { !-d "$webdir/$_" and system("mkdir -p $webdir/$_"); } qw(log rpmcheck input iso);
+map { !-d "$webdir/$_" and system("mkdir -p $webdir/$_") } qw(log rpmcheck input iso);
sub main_html {
#next_build_info;
@@ -44,7 +43,7 @@ sub show_general_info {
my $date_repo;
if (-f "$repo/$based_on/$arch/VERSION") {
$date_repo = read_file("$repo/$based_on/$arch/VERSION");
- } else { $date_repo = "UNKNOW date"; print "You should check that a VERSION file is present"; }
+ } else { $date_repo = "UNKNOW date"; print "You should check that a VERSION file is present" }
open my $B, ">$index";
print $B "<HTML>
<HEAD>
@@ -141,7 +140,7 @@ Pubkey: $media->{pubkey}
my $short_name = basename($files->{file});
print $B "<li><a href='input/$short_name'>$short_name</a></li>\n";
system("cp -af $files->{file} $webdir/input/");
- } else { print $B "<li><b>$files->{file} not present</b></li>"; }
+ } else { print $B "<li><b>$files->{file} not present</b></li>" }
}
print $B "</ul>\n";
@@ -153,7 +152,7 @@ Pubkey: $media->{pubkey}
my $short_name = basename($files->{file});
print $B "<li><a href='input/$short_name'>$short_name</a></li>\n";
system("cp -af $files->{file} $webdir/input/");
- } else { print $B "</li><b>$files->{file} not present</b></li>"; }
+ } else { print $B "</li><b>$files->{file} not present</b></li>" }
}
print $B "</ul>\n";
close $B;