linux-info.eclass: fix error/warning messages with ~!SYMBOLS
authorMike Frysinger <vapier@gentoo.org>
Sun, 17 Jan 2016 09:42:23 +0000 (04:42 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 17 Jan 2016 09:43:47 +0000 (04:43 -0500)
For ebuilds that do things like ~!IDE, the current warning system would
drop the ~ but not the !.  This would lead to doing variable expansion
like ${WARNING_!IDE} which is invalid shell code.

eclass/linux-info.eclass

index a913af29aead2a9134cb49938291b392ab5a49c2..25edb18a2e29814dbc2b586a4977c4d2069de99c 100644 (file)
@@ -716,13 +716,15 @@ check_extra_config() {
                        ewarn "to absence of any configured kernel sources or compiled"
                        ewarn "config:"
                        for config in ${CONFIG_CHECK}; do
-                               local_error="ERROR_${config#\~}"
+                               config=${config#\~}
+                               config=${config#\!}
+                               local_error="ERROR_${config}"
                                msg="${!local_error}"
-                               if [[ "x${msg}" == "x" ]]; then
-                                       local_error="WARNING_${config#\~}"
+                               if [[ -z ${msg} ]]; then
+                                       local_error="WARNING_${config}"
                                        msg="${!local_error}"
                                fi
-                               ewarn " - ${config#\~}${msg:+ - }${msg}"
+                               ewarn " - ${config}${msg:+ - }${msg}"
                        done
                        ewarn "You're on your own to make sure they are set if needed."
                        export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"