Hello community, here is the log from the commit of package perl-Bootloader checked in at Mon Apr 21 02:00:30 CEST 2008. -------- --- perl-Bootloader/perl-Bootloader.changes 2008-04-07 16:16:15.000000000 +0200 +++ perl-Bootloader/perl-Bootloader.changes 2008-04-18 16:36:03.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Apr 18 16:34:59 CEST 2008 - aosthof@suse.de + +- Fixed translation of unix devices to grub devices (bnc#375176) +- Version bump to 0.4.54 + +------------------------------------------------------------------- Old: ---- perl-Bootloader-0.4.53.tar.bz2 New: ---- perl-Bootloader-0.4.54.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.Y12889/_old 2008-04-21 01:58:57.000000000 +0200 +++ /var/tmp/diff_new_pack.Y12889/_new 2008-04-21 01:58:57.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package perl-Bootloader (Version 0.4.53) +# spec file for package perl-Bootloader (Version 0.4.54) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,7 +12,7 @@ Name: perl-Bootloader -Version: 0.4.53 +Version: 0.4.54 Release: 1 Requires: perl >= %{perl_version} Requires: perl-gettext @@ -67,6 +67,9 @@ /usr/lib/bootloader %changelog +* Fri Apr 18 2008 aosthof@suse.de +- Fixed translation of unix devices to grub devices (bnc#375176) +- Version bump to 0.4.54 * Mon Apr 07 2008 aosthof@suse.de - Prevent perl-Bootloader from segfaulting when loader type is set to "none" (bnc#362650) ++++++ perl-Bootloader-0.4.53.tar.bz2 -> perl-Bootloader-0.4.54.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.4.53/lib/Bootloader/Core/GRUB.pm new/perl-Bootloader-0.4.54/lib/Bootloader/Core/GRUB.pm --- old/perl-Bootloader-0.4.53/lib/Bootloader/Core/GRUB.pm 2008-04-03 17:56:40.000000000 +0200 +++ new/perl-Bootloader-0.4.54/lib/Bootloader/Core/GRUB.pm 2008-04-18 16:33:16.000000000 +0200 @@ -443,6 +443,12 @@ =cut +# Pattern for grub device specification. Please note that this does not work +# with BSD labeled disks which use things like "hd0,b" +# The pattern matches disk or floppy or network or cd +my $grubdev_pattern = "(?:hd\d+(?:,\d+)?|fd\d+|nd|cd)"; + + # string UnixDev2GrubDev (string unix_dev) sub UnixDev2GrubDev { my $self = shift; @@ -450,15 +456,19 @@ unless (defined($dev) and $dev) { $self->l_milestone ("GRUB::UnixDev2GrubDev: Empty device to translate"); - return $dev; + return ""; # return an error } # Seems to be a grub device already - if ($dev =~ /^\(.*\)$/) { + if ($dev =~ /^\(${grubdev_pattern}\)$/) { $self->l_milestone ("GRUB::UnixDev2GrubDev: Not translating device $dev"); return $dev; } - # This gives me the devicename, wether $dev is the device or a link! + # remove parenthesis to be able to handle entries like "(/dev/sda1)" which + # might be there by error + $dev =~ s/^\((.*)\)$/$1/; + + # This gives me the devicename, whether $dev is the device or a link! # This works for udev (kernel) devices only, devicemapper doesn't # need to be changed here my $original = $dev; @@ -524,12 +534,12 @@ $self->l_milestone ("GRUB::UnixDev2GrubDev: Internal structure device_map doesn't exist."); } - $self->l_milestone ("GRUB::UnixDev2GrubDev: Translated UNIX - device/partition -> GRUB device: $original to $dev"); + $self->l_milestone ("GRUB::UnixDev2GrubDev: Translated UNIX device/partition -> GRUB device: $original to $dev"); # fallback to grub device hd0 if translation has failed - this is good # enough for many cases - if ($dev !~ /^hd\d+$/) { + if ($dev !~ /^${grubdev_pattern}$/) { + $self->l_milestone ("GRUB::UnixDev2GrubDev: Unknown device '$dev', fall back to hd0"); $dev = "hd0"; } @@ -622,13 +632,17 @@ my $self = shift; my $orig_path = shift; my $preset_dev = shift; + my $dev; + my $path; - if ($orig_path =~ /^\(.+\).+$/) { - $self->l_milestone ("GRUB::UnixPath2GrubPath: Path $orig_path in GRUB form, keeping it"); - return $orig_path; + if ($orig_path =~ /^(\(.*\))(.+)$/) { + $self->l_milestone ("GRUB::UnixPath2GrubPath: Path $orig_path looks like in GRUB form, special treatment"); + $dev = $1; + $path = $2; + } + else { + ($dev, $path) = $self->SplitDevPath ($orig_path); } - - (my $dev, my $path) = $self->SplitDevPath ($orig_path); $dev = $self->UnixDev2GrubDev ($dev); if ($dev eq $preset_dev) { @@ -1581,7 +1595,7 @@ if ($grub_root ne "" or $noverify) { unshift @lines, { "key" => $noverify ? "rootnoverify" : "root", - "value" => $grub_root ne "" ? $grub_root : "(hd)", + "value" => $grub_root ne "" ? $grub_root : "(hd0)", # "value" => $grub_root ne "" ? $grub_root : "(hd0,0)", }; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org