summaryrefslogtreecommitdiffstats
path: root/move/tree/mdk_move_loop
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /move/tree/mdk_move_loop
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'move/tree/mdk_move_loop')
-rwxr-xr-xmove/tree/mdk_move_loop56
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;
-}