diff options
author | Mystery Man <unknown@mandriva.org> | 2005-08-30 18:55:27 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-08-30 18:55:27 +0000 |
commit | ea3a905b182f34bba2f071111d5263f1868c4a6f (patch) | |
tree | 45713836a82198448c93696b30f3c9ab7ba9aa4a /move/tree/mdk_move_loop | |
parent | f5427227e11f6025648f9537ffd3110c003f7e25 (diff) | |
download | drakx-backup-do-not-use-10_3_0_50mdk.tar drakx-backup-do-not-use-10_3_0_50mdk.tar.gz drakx-backup-do-not-use-10_3_0_50mdk.tar.bz2 drakx-backup-do-not-use-10_3_0_50mdk.tar.xz drakx-backup-do-not-use-10_3_0_50mdk.zip |
This commit was manufactured by cvs2svn to create tagV10_3_0_50mdk
'V10_3_0_50mdk'.
Diffstat (limited to 'move/tree/mdk_move_loop')
-rwxr-xr-x | move/tree/mdk_move_loop | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/move/tree/mdk_move_loop b/move/tree/mdk_move_loop deleted file mode 100755 index b98c4a417..000000000 --- a/move/tree/mdk_move_loop +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl - -sub name2file { - my ($name) = @_; - "live_tree_$name.clp"; -} - -sub get_file2loop { - my %file2loop; - foreach (0 .. 9) { - my ($file) = `sudo losetup /dev/loop$_ 2>/dev/null` =~ m!\([^)]*/([^)]*)\)! or last; - $file2loop{$file} = "loop$_"; - } - %file2loop; -} - -sub to_memory { - my ($loop, $file) = @_; - - return if -e "/tmp/$file"; - - if (-e "/$file") { - system("sudo mv /$file /tmp"); - } else { - system("sudo cp /cdrom/$file /tmp"); - } - system("sudo losetup /dev/$loop /tmp/$file"); -} - -sub to_cdrom { - my ($loop, $file) = @_; - my $f = -e "/$file" ? "/$file" : -e "/tmp/$file" ? "/tmp/$file" : return; - system("sudo losetup /dev/$loop /cdrom/$file"); - system("sudo rm $f"); -} - -sub usage() { die "usage: mdk_move_loop <to_cdrom | to_memory> [names ...]\n" } - -my ($direction, @names) = @ARGV; -my $f = $direction eq 'to_memory' && \&to_memory || $direction eq 'to_cdrom' && \&to_cdrom; -$f && @names or usage(); - -my %file2loop = get_file2loop(@names); - -foreach my $name (@names) { - if ($name eq 'always_i18n') { - /(always_i18n.*)\.clp/ and $name = $1 foreach keys %file2loop; - } - my $file = name2file($name); - my $loop = $file2loop{$file} or next; - $f->($loop, $file); -} - -if ($ENV{GIVE_LOOP}) { - print "$_=$file2loop{$_}\n" foreach keys %file2loop; -} |