Thread (1 message) 1 message, 1 author, 2016-07-19

Re: [PATCH] scripts/dtc: dtx_diff, before grep check .config file exists

From: Frank Rowand <hidden>
Date: 2016-07-19 12:07:31

On 07/19/16 01:33, Gaurav Minocha wrote:
quoted hunk
scripts/dtc/dtx_diff searches CONFIG_DTC=y in .config,
but it doesn't checks whether the file exists or not.

So, this patch adds a check for .config file.

Tested script with and without .config file.
quoted
/scripts/dtc/dtx_diff test.dts
Signed-off-by: Gaurav Minocha <redacted>
---
 scripts/dtc/dtx_diff | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/dtc/dtx_diff b/scripts/dtc/dtx_diff
index 959ab26..1c76dcd 100755
--- a/scripts/dtc/dtx_diff
+++ b/scripts/dtc/dtx_diff
@@ -266,7 +266,8 @@ DTC="${__KBUILD_OUTPUT}/scripts/dtc/dtc"
 
 if [ ! -x ${DTC} ] ; then
 	__DTC="dtc"
-	if grep -q "^CONFIG_DTC=y" ${__KBUILD_OUTPUT}/.config ; then
+	if [ -f "${__KBUILD_OUTPUT}/.config" ] && \
+		grep -q "^CONFIG_DTC=y" ${__KBUILD_OUTPUT}/.config ; then
 		make_command='
          make scripts'
 	else
Hi Gaurav,

Thanks for chasing that down.

Instead of checking for the existance of .config, can you just redirect
stderr from the grep to /dev/null and make sure that works?

You can add my acked-by if that passes your testing.

Thanks,

Frank
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help