diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-11-07 15:04:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-11-07 15:04:06 +0000 |
commit | fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227 (patch) | |
tree | fe3fd9afcfafe7540e9b580ae94e8befe476a5d3 /move/tree/mdk_move_loop | |
parent | 1b25bf451f1a16c314475d4ccdebbdda5a170f09 (diff) | |
download | drakx-fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227.tar drakx-fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227.tar.gz drakx-fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227.tar.bz2 drakx-fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227.tar.xz drakx-fd2e6cd9c2f41d57a7a2caf7e73a37e5beaa9227.zip |
- scan all loops, not only @names
- always_i18n is a magic name which is renamed to the used always_i18n_xxx
- return the file <=> loop association when asked
Diffstat (limited to 'move/tree/mdk_move_loop')
-rwxr-xr-x | move/tree/mdk_move_loop | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/move/tree/mdk_move_loop b/move/tree/mdk_move_loop index 08fff00f7..00158727d 100755 --- a/move/tree/mdk_move_loop +++ b/move/tree/mdk_move_loop @@ -6,15 +6,10 @@ sub name2file { } sub get_file2loop { - my (@names) = @_; - my %files = map { name2file($_) => 1 } @names; my %file2loop; foreach (0 .. 9) { my ($file) = `sudo losetup /dev/loop$_ 2>/dev/null` =~ m!\([^)]*/([^)]*)\)! or last; - if (delete $files{$file}) { - $file2loop{$file} = "loop$_"; - last if !%files; - } + $file2loop{$file} = "loop$_"; } %file2loop; } @@ -48,7 +43,14 @@ $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; +} |