[6/7] sanity.bbclass: catch an extra exception in check_create_long_filename

Submitted by Joshua Lock on May 24, 2012, 12:03 a.m. | Patch ID: 28513


Message ID 7c6800242465a59a46397518a29e632a795117d0.1337816265.git.josh@linux.intel.com
State Accepted
Commit b066906477eb0496a2babb3d8e87682a1b7df0de
Headers show

Commit Message

Joshua Lock May 24, 2012, 12:03 a.m.
The call to bb.mkdirhier() in check_create_long_filename() can fail with an
OSError, explicitly catch this and report something useful to the user.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
 meta/classes/sanity.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index e86edf7..4b52699 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -154,6 +154,8 @@  def check_create_long_filename(filepath, pathname):
             return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
             return "Failed to create a file in %s: %s.\n" % (pathname, strerror)
+    except OSError as (errno, strerror):
+        return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror)
     return ""
 def check_connectivity(d):