[OE-core] [PATCH 01/11] scripts/buildstats-diff: check that the given directory exists

Markus Lehtonen markus.lehtonen at linux.intel.com
Thu Sep 29 14:27:58 UTC 2016


Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 scripts/buildstats-diff | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/buildstats-diff b/scripts/buildstats-diff
index 8ee2aaf..d0cd766 100755
--- a/scripts/buildstats-diff
+++ b/scripts/buildstats-diff
@@ -115,11 +115,14 @@ def read_buildstats_dir(bs_dir):
 
     if os.path.isfile(os.path.join(bs_dir, 'build_stats')):
         top_dir = bs_dir
-    else:
+    elif os.path.exists(bs_dir):
         subdirs = sorted(glob.glob(bs_dir + '/*'))
         if len(subdirs) > 1:
             log.warning("Multiple buildstats found, using the first one")
         top_dir = subdirs[0]
+    else:
+        log.error("No such directory: %s", bs_dir)
+        sys.exit(1)
     log.debug("Reading buildstats directory %s", top_dir)
     subdirs = os.listdir(top_dir)
 
-- 
2.6.6




More information about the Openembedded-core mailing list