summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-09-29 11:55:29 +0000
committerThierry Vignaud <tv@mandriva.org>2009-09-29 11:55:29 +0000
commitb0233610e503d3a72855991c0aab57f02a809073 (patch)
tree748776c8be7110462c2d7234e49001588193a7c3 /perl-install
parent653c9bf63c577e5d626aefd0cd3f122a20ba165b (diff)
downloaddrakx-backup-do-not-use-b0233610e503d3a72855991c0aab57f02a809073.tar
drakx-backup-do-not-use-b0233610e503d3a72855991c0aab57f02a809073.tar.gz
drakx-backup-do-not-use-b0233610e503d3a72855991c0aab57f02a809073.tar.bz2
drakx-backup-do-not-use-b0233610e503d3a72855991c0aab57f02a809073.tar.xz
drakx-backup-do-not-use-b0233610e503d3a72855991c0aab57f02a809073.zip
(force_rename_field) extract it (needed for next commit)
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/harddrake214
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2
index 7700616d5..a8b0865b1 100755
--- a/perl-install/standalone/harddrake2
+++ b/perl-install/standalone/harddrake2
@@ -462,10 +462,7 @@ foreach (@classes) {
rename_field($_, 'usb_driver', 'driver');
rename_field($_, 'usb_id', 'id');
rename_field($_, 'usb_media_type', 'media_type');
- if ($_->{nice_media_type}) {
- delete $_->{media_type};
- rename_field($_, 'nice_media_type', 'media_type');
- }
+ force_rename_field($_, 'nice_media_type', 'media_type');
rename_field($_, 'usb_pci_bus', 'bus');
rename_field($_, 'nice_bus', 'bus');
rename_field($_, 'usb_vendor', 'vendor');
@@ -573,6 +570,15 @@ sub titleFormat {
[ $title . "\n", { 'weight' => Gtk2::Pango->PANGO_WEIGHT_BOLD, scale => Gtk2::Pango->PANGO_SCALE_LARGE } ];
}
+sub force_rename_field {
+ my ($dev, $new_field, $field) = @_;
+ if ($dev->{$new_field}) {
+ delete $dev->{$field};
+ rename_field($dev, $new_field, $field);
+ }
+}
+
+
sub rename_field {
my ($dev, $field, $new_field) = @_;
if ($dev->{$field}) {