Accepting request 33561 from Base:System
Copy from Base:System/perl-Bootloader based on submit request 33561 from user jreidinger OBS-URL: https://build.opensuse.org/request/show/33561 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl-Bootloader?expand=0&rev=88
This commit is contained in:
commit
3df48024ff
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:54c7d09e6d341194fcae3c1d091f41d13c113e28002108c730c9bc0061bd3f79
|
||||
size 52503
|
3
perl-Bootloader-0.5.9.tar.bz2
Normal file
3
perl-Bootloader-0.5.9.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a547cb8807a3ff3bcf728d906ed8c09dd4ba2dc92d6e95346e6f2331aad1c463
|
||||
size 52467
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 26 14:01:47 UTC 2010 - jreidinger@novell.com
|
||||
|
||||
- don't print outside if mdadm missing (bnc#578003)
|
||||
- fix splitting of values which now doesn't use that structure
|
||||
(bnc#566020)
|
||||
- adapt to new version of getting product description (bnc#583034)
|
||||
- 0.5.9
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jan 3 15:41:34 CET 2010 - jengelh@medozas.de
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package perl-Bootloader (Version 0.5.8)
|
||||
# spec file for package perl-Bootloader (Version 0.5.9)
|
||||
#
|
||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
|
||||
Name: perl-Bootloader
|
||||
Version: 0.5.8
|
||||
Release: 2
|
||||
Version: 0.5.9
|
||||
Release: 1
|
||||
Requires: perl-base = %{perl_version}
|
||||
Requires: e2fsprogs
|
||||
Recommends: perl-gettext
|
||||
|
@ -111,41 +111,22 @@ allowed together with --add operation
|
||||
=cut
|
||||
|
||||
# Get product name and version
|
||||
# FIXME: There is still no guaranteed-to-work solution
|
||||
# FIXME: as Commandline:: always prints to stderr, which is risky
|
||||
# FIXME: to get garbage.
|
||||
# If Commandline:: prints garbage, use /etc/SuSE-release instead
|
||||
# If zypper is not available or versions is empty, use /etc/SuSE-release instead
|
||||
# linux is last possible fallback
|
||||
|
||||
sub GetProduct {
|
||||
my $namever;
|
||||
|
||||
# first try: new zypp-query-pool adopted to our needs
|
||||
my @product_query = split ('\|', qx{/usr/lib/zypp/zypp-query-pool products \@system});
|
||||
my $found = 0;
|
||||
my $i = 0;
|
||||
|
||||
for ($i = 0; $i <= @product_query; $i++){
|
||||
if ($product_query[$i] eq "base"){
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# Determine the bootloader type, because long product names may only
|
||||
# be used in case of grub
|
||||
my $loader = Bootloader::Tools::GetBootloader();
|
||||
# Substitude whitespaces with an underscore
|
||||
if ($found){
|
||||
if ($loader ne "grub") {
|
||||
$namever = $product_query[$i+1];
|
||||
$namever =~ s/\s/_/g;
|
||||
}
|
||||
else{
|
||||
$namever = $product_query[$i+2];
|
||||
}
|
||||
chomp $namever;
|
||||
|
||||
# first try: use zypper
|
||||
if ( -f '/usr/bin/zypper' ){
|
||||
my $zypper_xml = qx{ZYPP_READONLY_HACK=1 zypper -qx --no-refresh pd -i | grep 'isbase="1"'};
|
||||
if ($zypper_xml =~ m/^.*summary="([^"]*)".*shortname="([^"]*)".*$/){
|
||||
return $1 if ($1 ne ""); #FIXME add here exceptions if bootloader has problems with long names
|
||||
return $2 if ($2 ne "");
|
||||
}
|
||||
}
|
||||
return "$namever" if $namever ne '' and $namever !~ /\n/;
|
||||
|
||||
|
||||
# Second try: Is there a usable /etc/SuSE-release?
|
||||
# This should really not be used anymore, as the syntax changed
|
||||
|
Loading…
x
Reference in New Issue
Block a user