From ec87a13c53945f9a5856f79b77914b5c15b4f9d3 Mon Sep 17 00:00:00 2001 From: Jacob Kjaergaard Date: Mon, 26 Jan 2015 16:10:23 +0100 Subject: [PATCH] binconfig_stage.oeclass: catch errors on symlinking and handle them. we sometimes get a throw on symlinking. We usually have to rebuild almost every thing. Instead this commit tries simply to force symlinking it. --- classes/binconfig-stage.oeclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/binconfig-stage.oeclass b/classes/binconfig-stage.oeclass index e1b644cd..53848488 100644 --- a/classes/binconfig-stage.oeclass +++ b/classes/binconfig-stage.oeclass @@ -83,7 +83,14 @@ def binconfig_stage_fixup(d): stage_dir, cross_type, d.get("stage_bindir").lstrip("/"), os.path.basename(filename)) print "symlinking %s to %s"%(dstlink, srcfile) - os.symlink(srcfile, dstlink) + import errno + try: + os.symlink(srcfile, dstlink) + except OSError as e: + if e.errno == errno.EEXIST: + os.remove(dstlink) + os.symlink(srcfile, dstlink) + # Local Variables: # mode: python