summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-02-17 16:17:31 +0000
committerOlivier Blin <oblin@mandriva.org>2006-02-17 16:17:31 +0000
commit9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778 (patch)
treeffabc55f24c007779378bd380f0aa99a92de15e7 /tools
parentbaac6c847740b601059c3ffe114eaea290830e39 (diff)
downloaddrakx-backup-do-not-use-9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778.tar
drakx-backup-do-not-use-9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778.tar.gz
drakx-backup-do-not-use-9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778.tar.bz2
drakx-backup-do-not-use-9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778.tar.xz
drakx-backup-do-not-use-9531f20c76bee0e01be0c9c0e88f6dcfd1e4c778.zip
move code in complete_config
Diffstat (limited to 'tools')
-rwxr-xr-xtools/draklive42
1 files changed, 22 insertions, 20 deletions
diff --git a/tools/draklive b/tools/draklive
index 0fd593331..473cf5b03 100755
--- a/tools/draklive
+++ b/tools/draklive
@@ -726,9 +726,6 @@ sub record_onthefly {
sub copy_wizard {
my ($live) = @_;
- #- assumes the current live media is mounted there
- $live->{workdir} = $live->{prefix}{live_mnt} . $live->{prefix}{media_mnt};
- $live->{mnt} = '/tmp/mnt';
my $root = get_workdir($live) . $live->{prefix}{boot};
my @available_storage = sort(grep { -d "$root/$_" && exists $storage{$_}{detect} } all($root));
my @available_devices;
@@ -791,15 +788,24 @@ sub copy_wizard {
sub complete_config {
my ($live) = @_;
- #- set unsupplied config dirs
- $live->{workdir} ||= '/tmp/draklive';
- $live->{mnt} ||= $live->{workdir} . "/mnt";
+ if ($live->{copy_wizard}) {
+ add2hash($live{prefix} ||= {}, $default_prefix);
+ #- assumes the current live media is mounted there
+ $live->{workdir} = $live->{prefix}{live_mnt} . $live->{prefix}{media_mnt};
+ $live->{mnt} = '/tmp/mnt';
+ } else {
+ #- set unsupplied config dirs
+ $live->{workdir} ||= '/tmp/draklive';
+ $live->{mnt} ||= $live->{workdir} . "/mnt";
+
+ #- check for minimum requirements
+ ref $live->{media} && $live->{media}{storage} or die "no media storage definition";
+ ref $live->{system} or die "no system definition";
+ $live->{system}{kernel} or die "no kernel has been configured";
+ mkdir_p(get_workdir($live));
- #- check for minimum requirements
- ref $live->{media} && $live->{media}{storage} or die "no media storage definition";
- ref $live->{system} or die "no system definition";
- $live->{system}{kernel} or die "no kernel has been configured";
- mkdir_p(get_workdir($live));
+ add2hash($live{prefix} ||= {}, $default_prefix);
+ }
}
sub clean {
@@ -850,20 +856,16 @@ GetOptions(
},
) or pod2usage();
-unless ($live{copy_wizard}) {
+require standalone;
+if ($live{copy_wizard}) {
+ complete_config(\%live);
+ copy_wizard(\%live);
+} else {
unless (keys(%live)) {
warn 'no live definition';
pod2usage();
}
complete_config(\%live);
-}
-add2hash($live{prefix} ||= {}, $default_prefix);
-
-require standalone;
-
-if ($live{copy_wizard}) {
- copy_wizard(\%live);
-} else {
every { !$_->{to_run} } @actions and die 'nothing to do';
foreach (grep { $_->{to_run} } @actions) {
print qq(* entering step "$_->{name}"\n);