diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-07-05 22:40:58 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-07-05 22:40:58 +0000 |
commit | 505353adf8da622c604a7818391d3fa0770f172f (patch) | |
tree | 6b69b3d8e64cde2bf0006fe2828890e27b72f30f | |
parent | 7df56d4019bbc73daa2bf5f8b6afebb062bf8075 (diff) | |
download | drakx-backup-do-not-use-505353adf8da622c604a7818391d3fa0770f172f.tar drakx-backup-do-not-use-505353adf8da622c604a7818391d3fa0770f172f.tar.gz drakx-backup-do-not-use-505353adf8da622c604a7818391d3fa0770f172f.tar.bz2 drakx-backup-do-not-use-505353adf8da622c604a7818391d3fa0770f172f.tar.xz drakx-backup-do-not-use-505353adf8da622c604a7818391d3fa0770f172f.zip |
(file2part): created
-rw-r--r-- | perl-install/fsedit.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index f5089cfd1..f7808dbf2 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -185,6 +185,27 @@ sub is_one_big_fat { @l == 1 && isFat($l[0]) && free_space(@$hds) < 10 << 11; } +sub file2part { + my ($prefix, $fstab, $file) = @_; + my $part; + + $file = expand_symlinks "$prefix$file"; + unless ($file =~ s/^$prefix//) { + my ($part) = grep { loopback::carryRootLoopback($_) } @$fstab or die; + log::l("found $part->{mntpoint}"); + $file =~ s|/initrd/loopfs|$part->{mntpoint}|; + } + foreach (@$fstab) { + my $m = $_->{mntpoint}; + $part = $_ if + $file =~ /^$m/ && + (!$part || length $part->{mntpoint} < length $m); + } + $part or die "file2part: not found $file"; + $file =~ s|$part->{mntpoint}/?|/|; + ($part, $file); +} + sub computeSize { my ($part, $best, $hds, $suggestions) = @_; |