- mchang: fix error caused by grub.cfg missing (bnc#769350)

- make dependency on Pod::Usage optional (bnc#760464)
- 0.6.5

OBS-URL: https://build.opensuse.org/package/show/Base:System/perl-Bootloader?expand=0&rev=60
This commit is contained in:
Steffen Winterfeldt 2012-06-29 14:22:48 +00:00 committed by Git OBS Bridge
parent 5154eab2f1
commit 502e9b4c92
5 changed files with 27 additions and 12 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:843ae762da6b0a05c2f9c94ec91bb835a4cdbed40d72465eb950c9376f4227c0
size 153132

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8b3aac82d1ae0343a591c935ba19b75f70cfa0909e1abd20048a78fe60d6d075
size 153289

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 29 16:20:02 CEST 2012 - snwint@suse.de
- mchang: fix error caused by grub.cfg missing (bnc#769350)
- make dependency on Pod::Usage optional (bnc#760464)
- 0.6.5
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jun 4 15:40:15 CEST 2012 - mchang@suse.com Mon Jun 4 15:40:15 CEST 2012 - mchang@suse.com

View File

@ -17,7 +17,7 @@
Name: perl-Bootloader Name: perl-Bootloader
Version: 0.6.4 Version: 0.6.5
Release: 0 Release: 0
Requires: perl-base = %{perl_version} Requires: perl-base = %{perl_version}
Requires: e2fsprogs Requires: e2fsprogs

View File

@ -2,12 +2,20 @@
use POSIX; use POSIX;
use Getopt::Long; use Getopt::Long;
use Pod::Usage;
use Bootloader::Tools; use Bootloader::Tools;
use Bootloader::Path; use Bootloader::Path;
use Bootloader::MBRTools; use Bootloader::MBRTools;
use strict; use strict;
# keep Pod::Usage optional (bnc #760464)
eval "use Pod::Usage";
if(!exists $::{pod2usage}) {
sub pod2usage {
die "usage: update-bootloader [operation] [options]\n";
}
}
my %oper; my %oper;
my ($opt_default, $opt_force, $opt_force_default, $opt_help, $opt_man, $opt_previous, $opt_xen) my ($opt_default, $opt_force, $opt_force_default, $opt_help, $opt_man, $opt_previous, $opt_xen)
= (0,0,0,0,0,0,0); = (0,0,0,0,0,0,0);
@ -184,13 +192,13 @@ GetOptions (\%oper,
pod2usage(1) if $opt_help; pod2usage(1) if $opt_help;
pod2usage(-exitstatus => 0, -verbose => 2) if $opt_man; pod2usage(-exitstatus => 0, -verbose => 2) if $opt_man;
pod2usage("Specify exactly one operation, either 'add', 'remove' or 'refresh'") die("Specify exactly one operation, either 'add', 'remove' or 'refresh'\n")
unless scalar keys(%oper) == 1; unless scalar keys(%oper) == 1;
pod2usage("Option 'default' is only allowed for operation 'add'") die("Option 'default' is only allowed for operation 'add'\n")
if ($opt_default and not defined $oper{add}); if ($opt_default and not defined $oper{add});
pod2usage("Option 'force-default' is only allowed for operation 'add'") die("Option 'force-default' is only allowed for operation 'add'\n")
if ($opt_force_default and not defined $oper{add}); if ($opt_force_default and not defined $oper{add});
if (defined $oper{"examinembr"}) { if (defined $oper{"examinembr"}) {
@ -382,7 +390,7 @@ if (defined $oper{add}) {
print LOG ("update-bootloader: changed opt name is $opt_name\n"); print LOG ("update-bootloader: changed opt name is $opt_name\n");
close LOG; close LOG;
pod2usage("Please specify name and kernel image for new section") die("Please specify name and kernel image for new section\n")
unless $opt_name and $opt_image; unless $opt_name and $opt_image;
my @params = ( my @params = (
@ -391,7 +399,7 @@ if (defined $oper{add}) {
); );
if (CountSections(@params) != 0) { if (CountSections(@params) != 0) {
if (not $opt_force) { if (not $opt_force) {
pod2usage("There are already sections with image '$opt_image'"); die("There are already sections with image '$opt_image'\n");
} }
open (LOG, ">>$logname"); open (LOG, ">>$logname");
print LOG ("update-bootloader: section already exist. Skip add.\n"); print LOG ("update-bootloader: section already exist. Skip add.\n");
@ -496,7 +504,7 @@ if (defined $oper{remove}) {
print LOG ("update-bootloader: found $num sections, no opt_force: not removing\n"); print LOG ("update-bootloader: found $num sections, no opt_force: not removing\n");
close LOG; close LOG;
pod2usage("There is more than one section with image '$opt_image'"); die("There is more than one section with image '$opt_image'\n");
} else { } else {
open (LOG, ">>$logname"); open (LOG, ">>$logname");
print LOG ("update-bootloader: calling Tools::RemoveSections\n"); print LOG ("update-bootloader: calling Tools::RemoveSections\n");