diff options
Diffstat (limited to 'BCD')
-rw-r--r-- | BCD/Common.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/BCD/Common.pm b/BCD/Common.pm index 5b6e538..ac91081 100644 --- a/BCD/Common.pm +++ b/BCD/Common.pm @@ -2,10 +2,12 @@ package BCD::Common; use strict; use XML::Simple; +use YAML; use MDK::Common; use Term::ANSIColor; use File::Copy::Recursive qw(dircopy pathrm); use File::Glob ':glob'; +use File::basename use BCD::Bcd qw(:DEFAULT); @@ -34,8 +36,17 @@ if (!$ARGV[0]) { 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 $isoconf = undef; + +if ($conf_file =~ /\.xml$/i) { + $isoconf = XMLin($conf_file, keyattr => ['']); +} elsif ($file =~ /\.yaml$/i) { + $isoconf = YAML::LoadFile($conf_file); +} else { + print_color("You must provide an XML or YAML config file", $color) and exit 1; +} our $DISTRIB = $isoconf->{theme}{name}; our $THEME = $isoconf->{theme}{theme}; |