SHA256
1
0
forked from pool/os-prober

Accepting request 428945 from home:michael-chang:branches:Base:System

- Parse /etc/os-release for openSUSE Tumbleweed (bsc#997465)
  * os-prober-linux-distro-parse-os-release.patch

OBS-URL: https://build.opensuse.org/request/show/428945
OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=67
This commit is contained in:
Andrei Borzenkov 2016-09-20 12:58:34 +00:00 committed by Git OBS Bridge
parent 9fddefe8e1
commit 1b693631e1
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,14 @@
Index: os-prober-1.70/os-probes/mounted/common/90linux-distro
===================================================================
--- os-prober-1.70.orig/os-probes/mounted/common/90linux-distro
+++ os-prober-1.70/os-probes/mounted/common/90linux-distro
@@ -117,6 +117,9 @@ elif [ -e "$dir/etc/lfs-release" ]; then
elif [ -e "$dir/etc/meego-release" ]; then
short="MeeGo"
long="$(head -1 "$dir/etc/meego-release")"
+elif [ -e "$dir/etc/os-release" ]; then
+ short=$(sed -n "/^NAME=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" $dir/etc/os-release)
+ long="$short $(sed -n "/^VERSION=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" $dir/etc/os-release)"
# This test is inaccurate, but given separate / and /boot partitions and the
# fact that only some architectures have ld-linux.so, I can't see anything
# better. Make sure this test has a high number so that more accurate tests

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 14 04:46:42 UTC 2016 - mchang@suse.com
- Parse /etc/os-release for openSUSE Tumbleweed (bsc#997465)
* os-prober-linux-distro-parse-os-release.patch
-------------------------------------------------------------------
Thu Dec 17 10:14:04 UTC 2015 - mchang@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package os-prober
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -66,6 +66,8 @@ Patch21: os-prober-btrfs-snapshot-detection.patch
Patch22: os-prober-btrfs-always-detect-default.patch
# PATCH-FIX-OPENSUSE: y2base runs at 100% cpu busy from beginning in installation of files to completion (bsc#953987)
Patch23: os-prober-linux-distro-avoid-expensive-ld-file-test.patch
# PATCH-FIX-OPENSUSE: Leap does not recognize Tumbleweed any more (bsc#997465)
Patch24: os-prober-linux-distro-parse-os-release.patch
Requires: /bin/grep
Requires: /bin/sed
Requires: /sbin/modprobe
@ -108,6 +110,7 @@ cp %{SOURCE1} .
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
find . -name \*.orig -delete
%build