Skip to content

Commit f91db14

Browse files
committed
detect-environment: Remove parsing of /etc/SuSE-release
On SUSE 12 the /etc/SuSE-release file exists with a deprecation warning. However, /etc/os-release also exists. So we might as well remove the parsing of the former and rely on the latter. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 6c82400 commit f91db14

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

build-scripts/detect-environment

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -194,33 +194,6 @@ detect_distribution()
194194

195195
OS=debian
196196
OS_VERSION="$REL"
197-
elif [ -f /etc/SuSE-release ]; then
198-
# This file is gone starting with suse 13 or something. This whole section
199-
# can be removed when support for suse 12 and lower is dropped. I wish to
200-
# see that day.
201-
REL=$(head -n1 /etc/SuSE-release)
202-
case "$REL" in
203-
"SUSE Linux Enterprise Server "*)
204-
MAJOR=$(grep '^VERSION' /etc/SuSE-release | awk '{print $3}')
205-
MINOR=$(grep '^PATCHLEVEL' /etc/SuSE-release | awk '{print $3}')
206-
207-
if [ -z "$MAJOR" ] || [ -z "$MINOR" ]; then
208-
echo "Unable to detect version of SLES: $MAJOR.$MINOR"
209-
fi
210-
211-
OS=sles
212-
OS_VERSION="$MAJOR.$MINOR"
213-
;;
214-
"openSUSE "*)
215-
VERSION=$(grep '^VERSION' /etc/SuSE-release | awk '{print $3}')
216-
OS=opensuse
217-
OS_VERSION="$VERSION"
218-
;;
219-
*)
220-
echo "Unknown SUSE distribution: $REL"
221-
exit 42
222-
;;
223-
esac
224197
elif [ -f /etc/os-release ]; then
225198
# see https://en.opensuse.org/SDB:Find_openSUSE_version for rules of
226199
# parsing this file

0 commit comments

Comments
 (0)