Hello community, here is the log from the commit of package perl-Bootloader checked in at Tue May 9 22:56:12 CEST 2006. -------- --- perl-Bootloader/perl-Bootloader.changes 2006-04-19 19:47:47.000000000 +0200 +++ STABLE/perl-Bootloader/perl-Bootloader.changes 2006-05-09 18:53:53.000000000 +0200 @@ -1,0 +2,6 @@ +Tue May 9 13:05:37 CEST 2006 - jplack@suse.de + +- follow symlinks for dev-by-id (#170588) +- bump version to 0.2.21 + +------------------------------------------------------------------- Old: ---- fix.diff perl-Bootloader-0.2.20.tar.bz2 New: ---- perl-Bootloader-0.2.21.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.i2HMVd/_old 2006-05-09 22:56:04.000000000 +0200 +++ /var/tmp/diff_new_pack.i2HMVd/_new 2006-05-09 22:56:04.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package perl-Bootloader (Version 0.2.20) +# spec file for package perl-Bootloader (Version 0.2.21) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,8 +11,8 @@ # norootforbuild Name: perl-Bootloader -Version: 0.2.20 -Release: 5 +Version: 0.2.21 +Release: 2 Requires: perl >= %{perl_version} Requires: perl-gettext Autoreqprov: on @@ -21,7 +21,6 @@ Summary: Library for Configuring Boot Loaders Source: perl-Bootloader-%{version}.tar.bz2 Source1: update-bootloader -Patch: fix.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -36,7 +35,6 @@ %prep #setup -n Bootloader-%{version} -q %setup -q -%patch -p1 %build perl Makefile.PL @@ -58,6 +56,9 @@ /sbin/update-bootloader %changelog -n perl-Bootloader +* Tue May 09 2006 - jplack@suse.de +- follow symlinks for dev-by-id (#170588) +- bump version to 0.2.21 * Wed Apr 19 2006 - agruen@suse.de - Fix a bug in CountSections(), and be more specific in update-bootloader, even though it shouldn't be necessary with ++++++ perl-Bootloader-0.2.20.tar.bz2 -> perl-Bootloader-0.2.21.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.2.20/lib/Bootloader/Core/GRUB.pm new/perl-Bootloader-0.2.21/lib/Bootloader/Core/GRUB.pm --- old/perl-Bootloader-0.2.20/lib/Bootloader/Core/GRUB.pm 2006-04-03 17:36:14.000000000 +0200 +++ new/perl-Bootloader-0.2.21/lib/Bootloader/Core/GRUB.pm 2006-04-28 19:01:15.000000000 +0200 @@ -198,23 +198,26 @@ my $self = shift; my $dev = shift; - if (defined ($dev) && $dev ne "" && $dev =~ /^\(.*\)$/) - { - $self->l_debug ("GRUB::UnixDev2GrubDev: Not translating device $dev"); + unless (defined($dev) and $dev) { + $self->l_debug ("GRUB::UnixDev2GrubDev: Empty device to translate"); return $dev; } - if ($dev eq "") - { - $self->l_debug ("GRUB::UnixDev2GrubDev: Empty device to translate"); + if ($dev =~ /^\(.*\)$/) { # seems to be a grub device already + $self->l_debug ("GRUB::UnixDev2GrubDev: Not translating device $dev"); return $dev; } my $original = $dev; my $partition = undef; - if ($dev =~ /\/dev\/md[0-9]+/) - { + if ($dev =~ m:/dev/md\d+:) { my @members = @{$self->MD2Members ($dev) || []}; + # FIXME! This only works for mirroring (Raid1) $dev = $members[0] || $dev; } + # check for symbolic links as they are used for dev-by-id and such + if ( -l "$dev") { + $dev = sprintf("%s/%s", $dev=~m:^(.+)/[^/]*$:, readlink($dev)); + $dev = $self->CanonicalPath($dev); + } foreach my $dev_ref (@{$self->{"partitions"}}) { if ($dev_ref->[0] eq $dev) @@ -240,7 +243,7 @@ =item C<< $unix_path = Bootloader::Core::GRUB->GrubPath2UnixPath ($grub_path, $grub_dev_prefix); >> -Translates the GRUB path (eg. '(hd0,0)/grub/device.map') to GRUB path (eg. +Translates the GRUB path (eg. '(hd0,0)/grub/device.map') to UNIX path (eg. '/boot/grub/device.map'). If the GRUB path doesn't contain the device, the one specified in the argument is used instead. As arguments, the function takes the GRUB path and the device to be used if not diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/perl-Bootloader-0.2.20/lib/Bootloader/Core.pm new/perl-Bootloader-0.2.21/lib/Bootloader/Core.pm --- old/perl-Bootloader-0.2.20/lib/Bootloader/Core.pm 2006-04-04 17:29:38.000000000 +0200 +++ new/perl-Bootloader-0.2.21/lib/Bootloader/Core.pm 2006-04-28 19:01:15.000000000 +0200 @@ -630,7 +630,8 @@ foreach my $line (@lilo_conf_lines) { - (my $new_lines_ref, $comment_before) = $self->ProcessSingleMenuFileLine ($line, $comment_before, $equal_sep); + (my $new_lines_ref, $comment_before) = + $self->ProcessSingleMenuFileLine ($line, $comment_before, $equal_sep); foreach my $l (@{$new_lines_ref}) { push @ret, $l; }; @@ -709,11 +710,11 @@ $line = $1; $comment_after = $2; } - if ($line =~ /=[ \t]*(.*)/ && $equal_sep) + if ($equal_sep && ($line =~ /=[ \t]*(.*)/)) { $value = $1; } - elsif ((! $equal_sep) && ($line !~ /^[ \t]*$/)) + elsif (!$equal_sep && ($line !~ /^[ \t]*$/)) { $value = $line; } @@ -1539,14 +1540,12 @@ my $files_ref = $self->ListFiles (); my @files = @{$files_ref}; my $ok = 1; - foreach my $file (@files) - { - my $new_exists = system ("test -f $file.new"); - if (0 == $new_exists) - { - my $status = system ( - "test -f $file.new && { test -f $file && mv $file $file.old; mv $file.new $file; } >/dev/null 2>&1"); - if (0 != $status) + foreach my $file (@files) { + if ( -f "$file.new" ) { + unless ( -f "$file" and + rename "$file", "$file.old" and + rename "$file.new", "$file" + ) { $self->l_error ("Core::UpdateBootloader: Error occurred while updating file $file"); $ok = undef; @@ -1777,7 +1776,7 @@ C<< $real = Bootloader::Core->RealFileName ($filename); >> -Gets the file name with all symlinks resolvfed and with some "beautification" +Gets the file name with all symlinks resolved and with some "beautification" (eg. removing duplicate slashes). Takes one argument - path, returns it after symlniks resolved. ++++++ update-bootloader ++++++ --- perl-Bootloader/update-bootloader 2006-04-19 19:47:19.000000000 +0200 +++ STABLE/perl-Bootloader/update-bootloader 2006-05-09 18:53:53.000000000 +0200 @@ -8,8 +8,8 @@ use strict; my %oper; -my ($opt_default, $opt_force, $opt_help, $opt_man, $opt_previous) - = (0,0,0,0,0); +my ($opt_default, $opt_force, $opt_help, $opt_man, $opt_previous, $opt_xen) + = (0,0,0,0,0,0); my ($opt_image, $opt_initrd, $opt_name, $opt_xen_kernel) = ('','','',''); my $add_product = 0; @@ -25,7 +25,7 @@ operation is one of --add, --remove or --refresh. valid options are --help, --man, --image <file>, --initrd <file>, ---xen-kernel <file>, --default, --previous, --name <string>, --force. +--xen-kernel <file>, --xen, --default, --previous, --name <string>, --force. =head1 OPERATIONS @@ -64,6 +64,11 @@ specify that you what to add a xen and not a regular image section +=item B<--xen-kernel> F<file> + +specify that you what to add a xen section with a specific image. +Implies --xen option. + =item B<--default> let the new section to be added be the default section. Only allowed together @@ -130,6 +135,7 @@ 'image=s' => \$opt_image, 'initrd=s' => \$opt_initrd, 'man|m' => \$opt_man, + 'xen' => \$opt_xen, 'xen-kernel=s' => \$opt_xen_kernel, 'name=s' => \$opt_name, 'previous|p' => \$opt_previous) @@ -149,7 +155,13 @@ if ($opt_initrd and $opt_initrd !~ m;^/;) { $opt_initrd = getcwd . '/' . $opt_initrd; } -my $type = $opt_xen_kernel ? "xen" : "image"; + +if (defined $opt_xen_kernel) { + $opt_xen = 1; +} elsif ($opt_xen) { + $opt_xen_kernel = "/boot/xen.gz"; +} +my $type = $opt_xen ? "xen" : "image"; InitLibrary(); @@ -169,7 +181,7 @@ my $loader = Bootloader::Tools::GetBootloader(); unless ($opt_name) { - if ($opt_xen_kernel and $opt_previous) { + if ($opt_xen and $opt_previous) { if ($loader eq "grub" || $loader eq "lilo") { $opt_name = "Previous Xen"; $add_product = 1; @@ -178,7 +190,7 @@ $opt_name = "previous xen"; } } - elsif ($opt_xen_kernel) { + elsif ($opt_xen) { if ($loader eq "grub" || $loader eq "lilo") { $opt_name = "Xen"; $add_product = 1; @@ -225,8 +237,7 @@ pod2usage("Please specify name and kernel image for new section") unless $opt_name and $opt_image; - - if (CountSections(type => $type, image => "$opt_image") != 0) + if (CountSections(type => "$type", image => "$opt_image") != 0) { if (not $opt_force) { pod2usage("There are already sections with image '$opt_image'"); @@ -246,22 +257,23 @@ } if (defined $oper{remove}) { - my $num = CountSections(type => $type, image => "$opt_image"); + my @params = ( + type =>$type eq "xen" ? "image" : $type, + image =>$opt_image, + ); + push @params, xen => $opt_xen_kernel if $type eq "xen"; + push @params, initrd=>$opt_initrd if $opt_initrd; + push @params, name =>$opt_name if $opt_name; + + my $num = CountSections(@params); if ($num > 0) { if ($num > 1 and not $opt_force) { pod2usage("There is more than one section with image '$opt_image'"); } else { - my @params = ( - type =>$type, - image =>$opt_image, - ); - push @params, xen => $opt_xen_kernel if $type eq "xen"; - push @params, initrd=>$opt_initrd if $opt_initrd; - RemoveSections(@params); } } elsif (not $opt_force) { - pod2usage("There in no section with image '$opt_image'"); + pod2usage("There is no section with image '$opt_image'"); } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...