From 2ebd2e5419829b62a480a95c5a38a5e1e8b8d96b60c4f8cb15f64abea2b0af91 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 4 Oct 2016 11:56:26 +0000 Subject: [PATCH] Accepting request 433076 from home:michael-chang:branches:Base:System - Handle /etc/os-release symlink (bsc#997465) * refresh os-prober-linux-distro-parse-os-release.patch OBS-URL: https://build.opensuse.org/request/show/433076 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=69 --- os-prober-linux-distro-parse-os-release.patch | 13 ++++++++++++- os-prober.changes | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/os-prober-linux-distro-parse-os-release.patch b/os-prober-linux-distro-parse-os-release.patch index 93dbd8b..5646631 100644 --- a/os-prober-linux-distro-parse-os-release.patch +++ b/os-prober-linux-distro-parse-os-release.patch @@ -2,10 +2,21 @@ 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 +@@ -117,6 +117,20 @@ elif [ -e "$dir/etc/lfs-release" ]; then elif [ -e "$dir/etc/meego-release" ]; then short="MeeGo" long="$(head -1 "$dir/etc/meego-release")" ++elif [ -L "$dir/etc/os-release" ]; then ++ RELPATH=$(readlink -f "$dir/etc/os-release") ++ if readlink "$dir/etc/os-release" | grep -q '^/'; then ++ RELPATH="$dir$RELPATH" ++ fi ++ if [ -f "$RELPATH" ]; then ++ short=$(sed -n "/^NAME=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" "$RELPATH") ++ long="$short $(sed -n "/^VERSION=/{s@\"\(.*\)\"@\1@;t 1;s@'\(.*\)'@\1@;: 1;s@^[^=]\+=@@;p;b}" "$RELPATH")" ++ else ++ exit 1 ++ fi +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)" diff --git a/os-prober.changes b/os-prober.changes index 743c93e..ac2b9d4 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 4 08:28:26 UTC 2016 - mchang@suse.com + +- Handle /etc/os-release symlink (bsc#997465) + * refresh os-prober-linux-distro-parse-os-release.patch + ------------------------------------------------------------------- Wed Sep 14 04:46:42 UTC 2016 - mchang@suse.com