aboutsummaryrefslogtreecommitdiffstats
path: root/BCD/Bcd.pm
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2010-10-06 07:58:18 +0000
committerAntoine Ginies <aginies@mandriva.com>2010-10-06 07:58:18 +0000
commitb364785ea90e60806aaaec56d15bcc70a74daf6d (patch)
treeda257e1277bd0218929f12fde2e318657067eb16 /BCD/Bcd.pm
parent46324a3fd9b86040b16dc3070b3a22438f7a616d (diff)
downloadbcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar
bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.gz
bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.bz2
bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.tar.xz
bcd-b364785ea90e60806aaaec56d15bcc70a74daf6d.zip
end of the move
Diffstat (limited to 'BCD/Bcd.pm')
-rw-r--r--BCD/Bcd.pm101
1 files changed, 101 insertions, 0 deletions
diff --git a/BCD/Bcd.pm b/BCD/Bcd.pm
new file mode 100644
index 0000000..98a68e1
--- /dev/null
+++ b/BCD/Bcd.pm
@@ -0,0 +1,101 @@
+package BCD::Bcd;
+
+use strict;
+use XML::Simple;
+use Data::Dumper;
+use Pod::Usage;
+use MDK::Common;
+
+use BCD::Resign;
+use BCD::Common qw(:DEFAULT $wd $isoconf $name $arch $version $isodir $builddir $error_color $dir_deps);
+use BCD::Genisoimage;
+use BCD::Isolinux;
+use BCD::Stagex;
+use BCD::Media;
+use BCD::Web;
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_bcd);
+our $conf_file;
+my $color = "cyan";
+
+sub print_info() {
+ print Dumper($isoconf);
+}
+
+sub help_bcd {
+ pod2usage('-verbose' => 2, '-input' => "bcd.pod", '-pathlist' => @INC);
+}
+
+sub do_all {
+ my ($option) = @_;
+ clean_all;
+ check_dir;
+ main_isolinux;
+ main_stagex;
+ main_media($option);
+ main_iso($option);
+ main_html;
+ show_info();
+}
+
+sub show_info {
+ print "\n";
+ print "ISO dir: $isodir\n";
+ print "build dir: $builddir\n";
+ print "LOG of media: /tmp/$name-$version-$arch\n";
+ print "stored URPMQ result: /var/lib/bcd/$name-$version-$arch\n";
+ print "\n";
+}
+
+sub main_bcd() {
+ my %opts = (
+ '' => \&help_bcd,
+ info => \&print_info,
+ iso => \&main_iso,
+ md5 => \&create_md5,
+ stagex => \&main_stagex,
+ isolinux => \&main_isolinux,
+ media => \&main_media,
+ gendistrib => \&use_gendistrib,
+ clean => \&clean_all,
+ list => \&list_media,
+ mediarepo => \&list_medias_available,
+ checkrepo => \&check_repo_hdlist,
+ rpmcheck => \&rpmcheck_launch,
+ doble => \&solve_doble_issue,
+ kernel => \&find_all_kernel,
+ resign => \&resign_media,
+ getsrpm => \&get_srpms_list,
+ clean => \&clean_urpmq_log,
+ html => \&main_html,
+ all => \&do_all,
+ );
+
+
+
+ if (! -d $dir_deps) {
+ print_color(" I will create $dir_deps to store all urpmq queries", $error_color);
+ print_color(" Please give full access RW to your current user to this directory", $color);
+ mkdir_p($dir_deps);
+ }
+ print_color("-- If you don't want to use previous urpmq query:\n ++ remove the directory $dir_deps\n ++ or remove the file wich contains the urpmq result for the package to redo an another one (ie: the file $dir_deps/tocopy_plop_todo_Main-drakconf)", $color);
+# $ARGV[0] or help_bcd;
+# -f $ARGV[0] or die "Cant acces to conf file $ARGV[0]\n";
+ if (my $f = $opts{$ARGV[1]}) {
+ if ($ARGV[2]) {
+ my $options;
+ foreach my $arg (2 .. $#ARGV) {
+ $arg and $options = $options . ' ' . $ARGV[$arg];
+ }
+ $f->($options);
+ } else {
+ $f->();
+ }
+ } else {
+ print_color(" ** Dont know what todo ** \n unknow option", $error_color);
+ }
+}
+
+
+1;