summaryrefslogtreecommitdiffstats
path: root/lib/MGA/DrakISO/Config.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MGA/DrakISO/Config.pm')
-rw-r--r--lib/MGA/DrakISO/Config.pm42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/MGA/DrakISO/Config.pm b/lib/MGA/DrakISO/Config.pm
index cda9695..a16e0cc 100644
--- a/lib/MGA/DrakISO/Config.pm
+++ b/lib/MGA/DrakISO/Config.pm
@@ -17,58 +17,58 @@ our $default_config_path = 'config/live.cfg';
our $default_settings_path = 'config/settings.cfg';
sub read_config {
- my ($live, $config_root, $config_path, $settings_path) = @_;
+ my ($build, $config_root, $config_path, $settings_path) = @_;
if ($config_path && -e getcwd() . '/' . $config_path) {
$config_root = getcwd();
}
print "using $config_root as directory root\n";
- add2hash($live->{settings} ||= {}, { getVarsFromSh($config_root . '/' . $settings_path) }) if $settings_path;
+ add2hash($build->{settings} ||= {}, { getVarsFromSh($config_root . '/' . $settings_path) }) if $settings_path;
if ($config_path) {
#- don't use do(), since it can't see lexicals in the enclosing scope
my $cfg = eval(cat_($config_root . '/' . $config_path)) or die "unable to load $config_path: $@\n";
- put_in_hash($live, $cfg);
+ put_in_hash($build, $cfg);
print "loaded $config_path as config file\n";
}
- $live->{settings}{config_root} = $config_root;
+ $build->{settings}{config_root} = $config_root;
}
sub check_config {
- my ($live) = @_;
- unless (keys(%$live)) {
+ my ($build) = @_;
+ unless (keys(%$build)) {
warn "no live definition\n";
Pod::Usage::pod2usage();
}
#- check for minimum requirements
- ref $live->{media} && $live->{media}{storage} or die "no media storage definition\n";
- ref $live->{system} or die "no system definition\n";
+ ref $build->{media} && $build->{media}{storage} or die "no media storage definition\n";
+ ref $build->{system} or die "no system definition\n";
}
sub complete_config {
- my ($live) = @_;
+ my ($build) = @_;
- $live->{settings}{builddir} ||= '/var/lib/draklive/build';
- $live->{settings}{chroot} ||= '/var/lib/draklive/chroot';
+ $build->{settings}{builddir} ||= '/var/lib/draklive/build';
+ $build->{settings}{chroot} ||= '/var/lib/draklive/chroot';
- $live->{settings}{arch} ||= chomp_(`rpm --eval '%{_target_cpu}'`);
- $live->{media}{title} ||= "live";
+ $build->{settings}{arch} ||= chomp_(`rpm --eval '%{_target_cpu}'`);
+ $build->{media}{title} ||= "live";
$_ = MGA::DrakISO::Media::new($_) foreach (
- $live->{media},
- ($live->{replicator} ? $live->{replicator}{media} : ()),
- ($live->{oem_rescue} ? $live->{oem_rescue}{media} : ()),
+ $build->{media},
+ ($build->{replicator} ? $build->{replicator}{media} : ()),
+ ($build->{oem_rescue} ? $build->{oem_rescue}{media} : ()),
);
- mkdir_p($live->get_builddir);
- mkdir_p($live->get_system_root);
- $live->{mnt} ||= $live->get_builddir . "/mnt";
+ mkdir_p($build->get_builddir);
+ mkdir_p($build->get_system_root);
+ $build->{mnt} ||= $build->get_builddir . "/mnt";
}
sub dump_config {
- my ($live) = @_;
+ my ($build) = @_;
use Data::Dumper;
- print Data::Dumper->Dump([ $live ], [ "live" ]);
+ print Data::Dumper->Dump([ $build ], [ "live" ]);
}
1;