diff options
author | Mystery Man <unknown@mandriva.org> | 2004-01-09 21:14:12 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2004-01-09 21:14:12 +0000 |
commit | 426b28dc63b1a571898e8edd580a0134e0239499 (patch) | |
tree | 8fbcfd82a41f005786abe4a1b1f1eef4cca01166 /move/make_live_tree_boot | |
parent | 9fc2f8c1fe91c12ae413617392b02ad12571d361 (diff) | |
download | drakx-426b28dc63b1a571898e8edd580a0134e0239499.tar drakx-426b28dc63b1a571898e8edd580a0134e0239499.tar.gz drakx-426b28dc63b1a571898e8edd580a0134e0239499.tar.bz2 drakx-426b28dc63b1a571898e8edd580a0134e0239499.tar.xz drakx-426b28dc63b1a571898e8edd580a0134e0239499.zip |
This commit was manufactured by cvs2svn to create tag 'V9_3_15mdk'.V9_3_15mdk
Diffstat (limited to 'move/make_live_tree_boot')
-rwxr-xr-x | move/make_live_tree_boot | 163 |
1 files changed, 0 insertions, 163 deletions
diff --git a/move/make_live_tree_boot b/move/make_live_tree_boot deleted file mode 100755 index 1af8d537e..000000000 --- a/move/make_live_tree_boot +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/perl - -use lib qw(../perl-install); -use common; -use lang; - -my $prefix = '/tmp/live_tree'; -my @ALLOWED_LANGS = split(' ', first(cat_('move.pm') =~ /ALLOWED_LANGS = qw\((.*)\)/)); - -sub create_light_tree { - my ($live_name, $list) = @_; - my $light_prefix = $prefix . '_' . $live_name; - - -e $light_prefix and die "you can't make_live_tree_boot since one already exists -Maybe you should remove it first with 'make_live_tree_boot -u'\n"; - - foreach my $orig (@$list) { - my $dest = $orig; - $dest =~ s|^$prefix|$light_prefix|; - - mkdir_p(dirname($dest)); - - if (-l $orig) { - symlink readlink($orig), $dest; - } else { - my $link = $orig; - $link =~ s|^$prefix|/image_$live_name|; - - rename $orig, $dest or die "moving $orig to $dest failed: $!\n"; - symlink $link, $orig or die "symlinking from $dest to $orig failed: $!\n"; - } - } -} - -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 $link; - my $fl = $f; - while (my $l = readlink("$prefix/$dir/$fl")) { - if ($l =~ /^\w/) { - $fl = $l; - next; - } elsif ($l =~ m!^/!) { - $link = $l; - } - last; - } - $link ||= "/image/$dir/$fl"; - symlink $link, "$light_prefix/$dir/$f"; - } - } -} - -sub remove_light_tree { - my ($live_name, $list) = @_; - my $light_prefix = $prefix . '_' . $live_name; - - -d $light_prefix or return; - - foreach my $dest (@$list) { - my $orig = $dest; - $orig =~ s|^$prefix|$light_prefix|; - - if (-l $orig) { - unlink $orig; - } elsif (-e $orig) { - if (-e $dest && -s $dest != -s $orig) { - warn "ERROR: $dest already exist, skipping\n"; - } elsif (!-d $dest || -l $dest) { - unlink $dest or die "removing $dest failed: $!\n"; - rename $orig, $dest or die "moving $orig to $dest failed: $!\n"; - } - } - } - rmdir($_) foreach reverse(chomp_(`find $light_prefix -type d`)); - - if (-e $light_prefix) { - unlink($_) foreach chomp_(`find $light_prefix -type l`); - - foreach my $orig (chomp_(`find $light_prefix -type f`)) { - my $dest = $orig; - $dest =~ s|^$light_prefix|$prefix|; - if (my $orig2 = readlink($dest)) { - $orig2 =~ s!/image_$live_name/!$light_prefix/! or next; - $orig2 eq $orig or next; - } else { - next if -e $dest && -s $dest != -s $orig; - } - unlink $dest or die "removing $dest failed: $!\n"; - rename $orig, $dest or die "moving $orig to $dest failed: $!\n"; - } - system("rm -rf $light_prefix/usr/bin/stage2/*.pm"); - system("rm -rf $light_prefix/usr/lib/libDrakX/*.pm"); - system("rm -rf $light_prefix/usr/share/langs/*.png"); - - rmdir($_) foreach reverse(chomp_(`find $light_prefix -type d`)); - } - - if (-e $light_prefix) { - print "still there:\n"; - system('find', $light_prefix); - } -} - -my @always_list = chomp_(cat_('data/always.list')); -my @boot_list_orig = chomp_(cat_('data/boot.list')); -my @totem_list_orig = chomp_(cat_('data/totem.list')); -my @nvidia_list = chomp_(cat_('data/nvidia.list')); -my @always_i18n_list = chomp_(cat_('data/always_i18n.list')); - -@always_list = uniq(@always_list, intersection(\@boot_list_orig, \@totem_list_orig)); - -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); -remove_light_tree('totem', \@totem_list); -remove_light_tree('nvidia', \@nvidia_list); -foreach my $lang (@ALLOWED_LANGS) { - remove_light_tree("always_i18n_$lang", []); -} - -if (!@ARGV) { - create_light_tree('always', \@always_list); - create_light_tree('boot', \@boot_list); - create_light_tree('totem', \@totem_list); - create_light_tree('nvidia', \@nvidia_list) if -e $nvidia_list[0]; - foreach my $lang (@ALLOWED_LANGS) { - my $full_lang = lang::l2locale($lang); - my ($short_lang) = $full_lang =~ /(..)/; - my @list = map { - my $s = $_; - $s =~ s/__LANG__/$full_lang/; - if (! -e $s) { - $s = $_; - $s =~ s/__LANG__/$short_lang/; - } - if (readlink($s) =~ m!^[^/]!) { - system('cp', $s, "$s-"); - rename "$s-", $s; - } - if_(-e $s, $s); - } @always_i18n_list; - create_light_tree("always_i18n_$lang", \@list); - } - create_totem_links('totem', \@totem_list_orig); -} |