summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/wild_device.pm
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 /perl-install/fs/wild_device.pm
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 'perl-install/fs/wild_device.pm')
-rw-r--r--perl-install/fs/wild_device.pm25
1 files changed, 13 insertions, 12 deletions
diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm
index 8fd38b0ce..dea15a4d3 100644
--- a/perl-install/fs/wild_device.pm
+++ b/perl-install/fs/wild_device.pm
@@ -43,17 +43,20 @@ sub to_subpart {
my $symlink = readlink("$::prefix$dev");
$dev =~ s!/u?dev/!!;
- if ($symlink && $symlink =~ m|^[^/]+$|) {
- $part{device_alias} = $dev;
- $dev = $symlink;
+ if ($symlink && $symlink !~ m!^/!) {
+ my $keep = 1;
+ if ($symlink =~ m!/!) {
+ $symlink = MDK::Common::File::concat_symlink("/dev/" . dirname($dev), $symlink);
+ $symlink =~ s!^/dev/!! or $keep = 0;
+ }
+ if ($keep) {
+ $part{device_LABEL} = $1 if $dev =~ m!^disk/by-label/(.*)!;
+ $part{device_alias} = $dev;
+ $dev = $symlink;
+ }
}
-
- if (my (undef, $part_number) = $dev =~ m!/(disc|part(\d+))$!) {
- $part{part_number} = $part_number if $part_number;
- $part{devfs_device} = $dev;
- } else {
- my $part_number = devices::part_number(\%part);
- $part{part_number} = $part_number if $part_number;
+ if (my $part_number = devices::part_number(\%part)) {
+ $part{part_number} = $part_number;
}
$part{device} = $dev;
return \%part;
@@ -73,8 +76,6 @@ sub from_part {
if ($part->{prefer_device_LABEL}) {
'LABEL=' . $part->{device_LABEL};
- } elsif ($part->{prefer_devfs_name}) {
- "/dev/$part->{devfs_device}";
} elsif ($part->{device_alias}) {
"/dev/$part->{device_alias}";
} else {