summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-11-05 12:36:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-11-05 12:36:02 +0000
commitdf40212f253267dbc9c3ad34d5a18b8e2fb2abdd (patch)
treef415e9ebef177267646172d1afec837cca57a0b5
parent34faf9c9f3a214eb02c43550f9f5a3f715e6cfd6 (diff)
downloaddrakx-df40212f253267dbc9c3ad34d5a18b8e2fb2abdd.tar
drakx-df40212f253267dbc9c3ad34d5a18b8e2fb2abdd.tar.gz
drakx-df40212f253267dbc9c3ad34d5a18b8e2fb2abdd.tar.bz2
drakx-df40212f253267dbc9c3ad34d5a18b8e2fb2abdd.tar.xz
drakx-df40212f253267dbc9c3ad34d5a18b8e2fb2abdd.zip
handle "totem" files being in "always"
-rwxr-xr-xmove/make_live_tree_boot42
1 files changed, 28 insertions, 14 deletions
diff --git a/move/make_live_tree_boot b/move/make_live_tree_boot
index bbd26f19d..b272af94e 100755
--- a/move/make_live_tree_boot
+++ b/move/make_live_tree_boot
@@ -15,8 +15,7 @@ Maybe you should remove it first with 'make_live_tree_boot -u'\n";
my $dest = $orig;
$dest =~ s|^$prefix|$light_prefix|;
- my $dir = dirname($dest);
- mkdir_p($dir);
+ mkdir_p(dirname($dest));
if (-l $orig) {
symlink readlink($orig), $dest;
@@ -28,14 +27,28 @@ Maybe you should remove it first with 'make_live_tree_boot -u'\n";
symlink $link, $orig or die "symlinking from $dest to $orig failed: $!\n";
}
}
+}
- if ($live_name eq 'totem') {
- foreach my $dir (chomp_(`cd $light_prefix ; find usr -type d`)) {
- foreach my $f (all("$prefix/$dir")) {
- my $file = "$prefix/$dir/$f";
- my $link = readlink($file) =~ /^\w/ ? readlink($file) : "/image/$dir/$f";
- symlink $link, "$light_prefix/$dir/$f";
- }
+sub create_totem_links {
+ my ($live_name, $list) = @_;
+ my $light_prefix = $prefix . '_' . $live_name;
+
+ #- creating all the dirs, even when things are in the "always" tree
+ foreach my $orig (@$list) {
+ my $dest = $orig;
+ $dest =~ s|^$prefix|$light_prefix|;
+ mkdir_p(dirname($dest)) if ! (-e $dest || -l $dest);
+
+ if (-l $orig) {
+ symlink readlink($orig), $dest;
+ }
+ }
+
+ foreach my $dir (chomp_(`cd $light_prefix ; find usr -type d`)) {
+ foreach my $f (all("$prefix/$dir")) {
+ my $file = "$prefix/$dir/$f";
+ my $link = readlink($file) =~ /^\w/ ? readlink($file) : "/image/$dir/$f";
+ symlink $link, "$light_prefix/$dir/$f";
}
}
}
@@ -92,13 +105,13 @@ sub remove_light_tree {
}
my @always_list = chomp_(cat_('data/always.list'));
-my @boot_list = chomp_(cat_('data/boot.list'));
-my @totem_list = chomp_(cat_('data/totem.list'));
+my @boot_list_orig = chomp_(cat_('data/boot.list'));
+my @totem_list_orig = chomp_(cat_('data/totem.list'));
-@always_list = uniq(@always_list, intersection(\@boot_list, \@totem_list));
+@always_list = uniq(@always_list, intersection(\@boot_list_orig, \@totem_list_orig));
-@boot_list = difference2(\@boot_list, \@always_list);
-@totem_list = difference2(\@totem_list, \@always_list);
+my @boot_list = difference2(\@boot_list_orig, \@always_list);
+my @totem_list = difference2(\@totem_list_orig, \@always_list);
remove_light_tree('always', \@always_list);
remove_light_tree('boot', \@boot_list);
@@ -108,4 +121,5 @@ if (!@ARGV) {
create_light_tree('always', \@always_list);
create_light_tree('boot', \@boot_list);
create_light_tree('totem', \@totem_list);
+ create_totem_links('totem', \@totem_list_orig);
}