aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2010-11-29 09:02:12 +0000
committerAntoine Ginies <aginies@mandriva.com>2010-11-29 09:02:12 +0000
commit6233db7abdcbde7a4d3d5a9a5caa69275a06baf5 (patch)
tree3218c3f1294f0af7cfe309e0d20d0e8614b5450b
parent05a3ae25944bf3814268d3d4b71876301087cf64 (diff)
downloadbcd-6233db7abdcbde7a4d3d5a9a5caa69275a06baf5.tar
bcd-6233db7abdcbde7a4d3d5a9a5caa69275a06baf5.tar.gz
bcd-6233db7abdcbde7a4d3d5a9a5caa69275a06baf5.tar.bz2
bcd-6233db7abdcbde7a4d3d5a9a5caa69275a06baf5.tar.xz
bcd-6233db7abdcbde7a4d3d5a9a5caa69275a06baf5.zip
sync ith latest BCD
-rw-r--r--BCD/Common.pm25
-rw-r--r--BCD/Resign.pm21
-rw-r--r--BCD/Stagex.pm12
3 files changed, 46 insertions, 12 deletions
diff --git a/BCD/Common.pm b/BCD/Common.pm
index b23cbd8..df200b5 100644
--- a/BCD/Common.pm
+++ b/BCD/Common.pm
@@ -12,13 +12,29 @@ use BCD::Bcd qw(:DEFAULT);
our @ISA = qw(Exporter);
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);
+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);
my $LOG="COMMON -";
my $color = "red";
+our @list_of_removed;
-my $conf_file = $ARGV[0];
+my ($sec,$min,$hour,$mday,$mon,$year,undef,undef,undef)= localtime(time);
+$year = $year + 1900; $mon = $mon + 1;
+our $date = $year . '_' . $mon . '_' . $mday . '-' . $hour . 'h' . $min . '-' . $sec;
+
+sub whereisthedoc {
+ print_color(" 'man bcd' and man 'conf.xml'\nREAD the full documentation in pdf format available in the /usr/share/doc/bcd dir",$color) and exit 1;
+}
+if (!$ARGV[0]) {
+ print_color(" First arg must be the XML file to use!", $color);
+ whereisthedoc;
+} elsif (!$ARGV[1]) {
+ print_color(" You must do an action ! actions are:", $color);
+ print_color("###\nstagex isolinux clean media gendistrib rpmcheck list mediarepo checkrepo all\nmd5 resign clean doble nodoble kernel info iso verbose\n###", $color);
+ whereisthedoc;
+}
+our $conf_file = $ARGV[0];
our $isoconf = XMLin($conf_file, keyattr => ['']);
our $DISTRIB = $isoconf->{theme}{name};
@@ -31,7 +47,6 @@ our $version = $isoconf->{mediainfo}{version};
our $repo = $isoconf->{repo}{path};
our $based_on = $isoconf->{based_on};
-$ARGV[0] or print_color("You must define wich XML file to use!\n'man bcd' and man 'conf.xml', and read the full documentation in pdf format available in the /usr/share/doc/bcd dir",$color) and exit 1;
$DISTRIB or print_color("You must define the <theme><name> tag",$color) and exit 1;
$THEME or print_color("You must define the <theme><theme> tag",$color) and exit 1;
$name or print_color("You must define the <namedid> tag",$color) and exit 1;
@@ -44,9 +59,9 @@ $based_on or print_color("You must define the <based_on> tag",$color) and exit 1
# password file
#"/home/plop/.signature.gpg";
-my $pwd_file = $isoconf->{signature};
+our $pwd_file = $isoconf->{signature};
#"/home/plop/.rpmrc";
-my $rpmrc = $isoconf->{rpmrc};
+our $rpmrc = $isoconf->{rpmrc};
# where to store urpmq queries results
our $dir_deps = "/var/lib/bcd/$name-$version-$arch";
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";
diff --git a/BCD/Stagex.pm b/BCD/Stagex.pm
index 5791ae1..ed9bd2d 100644
--- a/BCD/Stagex.pm
+++ b/BCD/Stagex.pm
@@ -58,6 +58,17 @@ sub copy_doc {
}
}
+sub copy_misc {
+ print_color("$LOG copy of misc directory from $repo/$based_on/$arch to $builddir/../", $color);
+ 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/");
+ } else {
+ print_color("$LOG FAILED copy of misc directory from $repo/$based_on/$arch", $error_color);
+ }
+}
+
sub patch_oem {
if (-f $isoconf->{installer}{patch}) {
print_color("$LOG copy $isoconf->{installer}{patch} to $installer_destdir/", $color);
@@ -70,6 +81,7 @@ sub main_stagex {
update_advertising;
copy_dosutils;
copy_doc;
+ copy_misc;
patch_oem;
}