linux-info.eclass: linux-info_get_any_version, die on failure
authorMichał Górny <mgorny@gentoo.org>
Thu, 8 Mar 2018 16:04:52 +0000 (17:04 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 9 Jul 2018 16:54:45 +0000 (18:54 +0200)
Make linux-info_get_any_version die if it can't determine any version
of the Linux kernel. This indicates a problem with the eclass code
(as it should not happen on Linux) and the missing KV_* variables
are going to cause random misbehavior and failures.

eclass/linux-info.eclass

index d5eb0e73fcfa42d569b319fd79c3d1e01f09aca0..5adecb3a26968b0845e948895a5f09dfe46579f9 100644 (file)
@@ -630,7 +630,9 @@ get_running_version() {
 linux-info_get_any_version() {
        if ! get_version; then
                ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
-               get_running_version
+               if ! get_running_version; then
+                       die "Unable to determine any Linux Kernel version, please report a bug"
+               fi
        fi
 }