Skip to contentSkip to conversation

kconfig: be more helpful if pkg-config is missing

PATCH Superseded Alyssa Ross 2 participants 5 messages Nov 4, 2019 – Nov 6, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kconfig: be more helpful if pkg-config is missing

If ncurses is installed, but at a non-default location, the previous error message was not helpful in resolving the situation. Now, if ncurses can't be found, and pkg-config is not installed, it will suggest that pkg-config might need to be installed in addition to ncurses.

---
 scripts/kconfig/mconf-cfg.sh | 14 ++++++++++++--
 scripts/kconfig/nconf-cfg.sh | 14 ++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)
scripts/kconfig/mconf-cfg.sh +12 -2
index c812872d7f9d..f547b13f77f6 100755
@@ -41,7 +41,17 @@ fi
 
 echo >&2 "*"
 echo >&2 "* Unable to find the ncurses package."
-echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
-echo >&2 "* depending on your distribution)."
+echo >&2 "*"
+if [ -n "$(command -v pkg-config)" ]; then
+	echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+else
+	echo >&2 "* You may need to install ncurses"
+	echo >&2 "* (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+	echo >&2 "*"
+	echo >&2 "* If you have ncurses installed,"
+	echo >&2 "* you may also need to install pkg-config."
+fi
 echo >&2 "*"
 exit 1
scripts/kconfig/nconf-cfg.sh +12 -2
index 001559ef0a60..569226f1b497 100755
@@ -41,7 +41,17 @@ fi
 
 echo >&2 "*"
 echo >&2 "* Unable to find the ncurses package."
-echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
-echo >&2 "* depending on your distribution)."
+echo >&2 "*"
+if [ -n "$(command -v pkg-config)" ]; then
+	echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+else
+	echo >&2 "* You may need to install ncurses"
+	echo >&2 "* (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+	echo >&2 "*"
+	echo >&2 "* If you have ncurses installed,"
+	echo >&2 "* you may also need to install pkg-config."
+fi
 echo >&2 "*"
 exit 1
Signature · 1 line
2.23.0
#1 lore raw
Quoted 9 lines · Alyssa Ross

If ncurses is installed, but at a non-default location, the previous error message was not helpful in resolving the situation. Now, if ncurses can't be found, and pkg-config is not installed, it will suggest that pkg-config might need to be installed in addition to ncurses.

---

I do not like to complicate the error message.

How about appending a little more info, like this?

*
* Unable to find the ncurses package.
* Install ncurses (ncurses-devel or libncurses-dev
* depending on your distribution).
*
* You may also need to install pkg-config to find the
* ncurses installed in a non-default location. *

Thanks.

Quoted 55 lines
 scripts/kconfig/mconf-cfg.sh | 14 ++++++++++++--
 scripts/kconfig/nconf-cfg.sh | 14 ++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)
scripts/kconfig/mconf-cfg.sh +12 -2
index c812872d7f9d..f547b13f77f6 100755
@@ -41,7 +41,17 @@ fi
 
 echo >&2 "*"
 echo >&2 "* Unable to find the ncurses package."
-echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
-echo >&2 "* depending on your distribution)."
+echo >&2 "*"
+if [ -n "$(command -v pkg-config)" ]; then
+       echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
+       echo >&2 "* depending on your distribution)."
+else
+       echo >&2 "* You may need to install ncurses"
+       echo >&2 "* (ncurses-devel or libncurses-dev"
+       echo >&2 "* depending on your distribution)."
+       echo >&2 "*"
+       echo >&2 "* If you have ncurses installed,"
+       echo >&2 "* you may also need to install pkg-config."
+fi
 echo >&2 "*"
 exit 1
scripts/kconfig/nconf-cfg.sh +12 -3
index 001559ef0a60..569226f1b497 100755
@@ -41,7 +41,17 @@ fi
 
 echo >&2 "*"
 echo >&2 "* Unable to find the ncurses package."
-echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
-echo >&2 "* depending on your distribution)."
+echo >&2 "*"
+if [ -n "$(command -v pkg-config)" ]; then
+       echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
+       echo >&2 "* depending on your distribution)."
+else
+       echo >&2 "* You may need to install ncurses"
+       echo >&2 "* (ncurses-devel or libncurses-dev"
+       echo >&2 "* depending on your distribution)."
+       echo >&2 "*"
+       echo >&2 "* If you have ncurses installed,"
+       echo >&2 "* you may also need to install pkg-config."
+fi
 echo >&2 "*"
 exit 1
--

2.23.0

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

PATCH v2 1/1 kconfig: be more helpful if pkg-config is missing

If ncurses is installed, but at a non-default location, the previous error message was not helpful in resolving the situation. Now it will suggest that pkg-config might need to be installed in addition to ncurses.

---
 scripts/kconfig/mconf-cfg.sh |  3 +++
 scripts/kconfig/nconf-cfg.sh | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
scripts/kconfig/mconf-cfg.sh +3 -0
index c812872d7f9d..aa68ec95620d 100755
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
 echo >&2 "* depending on your distribution)."
 echo >&2 "*"
+echo >&2 "* You may also need to install pkg-config to find the"
+echo >&2 "* ncurses installed in a non-default location."
+echo >&2 "*"
 exit 1
scripts/kconfig/nconf-cfg.sh +12 -2
index 001559ef0a60..569226f1b497 100755
@@ -41,7 +41,17 @@ fi
 
 echo >&2 "*"
 echo >&2 "* Unable to find the ncurses package."
-echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
-echo >&2 "* depending on your distribution)."
+echo >&2 "*"
+if [ -n "$(command -v pkg-config)" ]; then
+	echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+else
+	echo >&2 "* You may need to install ncurses"
+	echo >&2 "* (ncurses-devel or libncurses-dev"
+	echo >&2 "* depending on your distribution)."
+	echo >&2 "*"
+	echo >&2 "* If you have ncurses installed,"
+	echo >&2 "* you may also need to install pkg-config."
+fi
 echo >&2 "*"
 exit 1
Signature · 1 line
2.23.0
#3 lore raw

PATCH v3 1/1 kconfig: be more helpful if pkg-config is missing

If ncurses is installed, but at a non-default location, the previous error message was not helpful in resolving the situation. Now it will suggest that pkg-config might need to be installed in addition to ncurses.

---
Apologies -- was a little too hasty in sending v2, and it only included the updated message in one of the two files that needed to be changed.

 scripts/kconfig/mconf-cfg.sh | 3 +++
 scripts/kconfig/nconf-cfg.sh | 3 +++
 2 files changed, 6 insertions(+)
scripts/kconfig/mconf-cfg.sh +3 -0
index c812872d7f9d..aa68ec95620d 100755
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
 echo >&2 "* depending on your distribution)."
 echo >&2 "*"
+echo >&2 "* You may also need to install pkg-config to find the"
+echo >&2 "* ncurses installed in a non-default location."
+echo >&2 "*"
 exit 1
scripts/kconfig/nconf-cfg.sh +3 -0
index 001559ef0a60..c212255070c0 100755
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
 echo >&2 "* depending on your distribution)."
 echo >&2 "*"
+echo >&2 "* You may also need to install pkg-config to find the"
+echo >&2 "* ncurses installed in a non-default location."
+echo >&2 "*"
 exit 1
Signature · 1 line
2.23.0
#4 lore raw
Quoted 7 lines · Alyssa Ross

If ncurses is installed, but at a non-default location, the previous error message was not helpful in resolving the situation. Now it will suggest that pkg-config might need to be installed in addition to ncurses.

Applied to linux-kbuild.
Thanks.

Quoted 36 lines

---
Apologies -- was a little too hasty in sending v2, and it only included the updated message in one of the two files that needed to be changed.

 scripts/kconfig/mconf-cfg.sh | 3 +++
 scripts/kconfig/nconf-cfg.sh | 3 +++
 2 files changed, 6 insertions(+)
scripts/kconfig/mconf-cfg.sh +3 -0
index c812872d7f9d..aa68ec95620d 100755
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
 echo >&2 "* depending on your distribution)."
 echo >&2 "*"
+echo >&2 "* You may also need to install pkg-config to find the"
+echo >&2 "* ncurses installed in a non-default location."
+echo >&2 "*"
 exit 1
scripts/kconfig/nconf-cfg.sh +3 -1
index 001559ef0a60..c212255070c0 100755
@@ -44,4 +44,7 @@ echo >&2 "* Unable to find the ncurses package."
 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
 echo >&2 "* depending on your distribution)."
 echo >&2 "*"
+echo >&2 "* You may also need to install pkg-config to find the"
+echo >&2 "* ncurses installed in a non-default location."
+echo >&2 "*"
 exit 1
--

2.23.0

Signature · 2 lines
Best Regards
Masahiro Yamada