diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-11-24 16:44:47 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-11-24 16:44:47 +0000 |
commit | c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba (patch) | |
tree | 89248832df79a34d7441d87f6fefa0f5e7a73ffb /perl-install/standalone/harddrake2 | |
parent | 8b15f02e37ec4c8f1c00b2e22f12c6ec9fef802c (diff) | |
download | drakx-c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba.tar drakx-c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba.tar.gz drakx-c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba.tar.bz2 drakx-c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba.tar.xz drakx-c1755fab0a585fd0fd7f84c38d8ccd395fdfcbba.zip |
(format_bus_ids) extract it (needed for next commit)
Diffstat (limited to 'perl-install/standalone/harddrake2')
-rwxr-xr-x | perl-install/standalone/harddrake2 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index 6763f77a1..02b0d08ce 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -474,10 +474,7 @@ foreach (@classes) { foreach my $field (qw(device)) { $_->{$field} = "/dev/$_->{$field}" if $_->{$field}; } - foreach my $field (qw(vendor id subvendor subid)) { - $_->{$field} = sprintf("0x%04x", $_->{$field}); - delete $_->{$field} if $_->{$field} eq "0xffff"; # 0xffff equals to '*' - } + format_bus_ids($_); if ($_->{pci_revision}) { $_->{pci_revision} = sprintf("0x%02x", $_->{pci_revision}); } else { @@ -492,6 +489,15 @@ foreach (@classes) { undef $flush_guard; +sub format_bus_ids { + my ($device) = $_; + foreach my $field (qw(vendor id subvendor subid)) { + next if !$device->{$field}; + $device->{$field} = sprintf("0x%04x", $device->{$field}); + delete $device->{$field} if $device->{$field} eq "0xffff"; # 0xffff equals to '*' + } +} + sub reap_children() { # reap zombies my $child_pid; |