From b5fe3282d2d44d858990639cb7d13aae53e07170 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Sat, 16 May 2020 11:33:17 +0200 Subject: Don't exit if newest kernel is selected It was really never a good idea to make this a fatal error, especially considering consecutive calls of kern(1) without any arguments will fail after the kernel has been set successfully once. --- kern | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kern b/kern index f4a8be3..c6b2a57 100755 --- a/kern +++ b/kern @@ -5,8 +5,12 @@ set -e SRCDIR=/usr/src KERNFRAG=${KERNFRAG:-/etc/kernfrag} -errx() { +err() { printf "kern: %s\n" "$@" >&2 +} + +errx() { + err "$@" exit 1 } @@ -36,7 +40,8 @@ set_kernel() { fi if test "$kern" = "$current"; then - errx "Latest kernel already selected: $kern" + err "Warning: Latest kernel already selected: $kern" + return fi printf "Selecting kernel: %s\n" "$kern" -- cgit v1.2.3-2-gb3c3