summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-13 05:34:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-13 05:34:30 +0000
commit236b47f5fcf5b70a6156b495dfc2e517d4d21abc (patch)
tree5e87a891cf5058d8c52021370c0ef79697a182fe /perl-install/fs
parent0935fb7e249568209af72cce0094feee6a11036c (diff)
downloaddrakx-backup-do-not-use-236b47f5fcf5b70a6156b495dfc2e517d4d21abc.tar
drakx-backup-do-not-use-236b47f5fcf5b70a6156b495dfc2e517d4d21abc.tar.gz
drakx-backup-do-not-use-236b47f5fcf5b70a6156b495dfc2e517d4d21abc.tar.bz2
drakx-backup-do-not-use-236b47f5fcf5b70a6156b495dfc2e517d4d21abc.tar.xz
drakx-backup-do-not-use-236b47f5fcf5b70a6156b495dfc2e517d4d21abc.zip
fsedit::is_same_hd is now fs:get::is_same_hd
Diffstat (limited to 'perl-install/fs')
-rw-r--r--perl-install/fs/get.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/fs/get.pm b/perl-install/fs/get.pm
index dca0a5aa9..5ea9071a8 100644
--- a/perl-install/fs/get.pm
+++ b/perl-install/fs/get.pm
@@ -71,7 +71,7 @@ sub hds_fstab_and_holes {
sub device2part {
my ($dev, $fstab) = @_;
my $subpart = fs::subpart_from_wild_device_name($dev);
- my $part = find { fsedit::is_same_hd($subpart, $_) } @$fstab;
+ my $part = find { is_same_hd($subpart, $_) } @$fstab;
log::l("fs::get::device2part: unknown device <<$dev>>") if !$part;
$part;
}
@@ -126,4 +126,18 @@ sub up_mount_point {
}
}
+sub is_same_hd {
+ my ($hd1, $hd2) = @_;
+ if ($hd1->{major} && $hd2->{major}) {
+ $hd1->{major} == $hd2->{major} && $hd1->{minor} == $hd2->{minor};
+ } elsif (my ($s1) = $hd1->{device} =~ m|https?://(.+?)/*$|) {
+ my ($s2) = $hd2->{device} =~ m|https?://(.+?)/*$|;
+ $s1 eq $s2;
+ } else {
+ $hd1->{devfs_device} && $hd2->{devfs_device} && $hd1->{devfs_device} eq $hd2->{devfs_device}
+ || $hd1->{device_LABEL} && $hd2->{device_LABEL} && $hd1->{device_LABEL} eq $hd2->{device_LABEL}
+ || $hd1->{device} && $hd2->{device} && $hd1->{device} eq $hd2->{device};
+ }
+}
+
1;