diff options
Diffstat (limited to 'BCD/Common.pm')
-rw-r--r-- | BCD/Common.pm | 25 |
1 files changed, 20 insertions, 5 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"; |