All of lore.kernel.org
 help / color / mirror / Atom feed
From: brian avery <avery.brian@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH V3 1/1] gen-lockedsig-cache: catch os.link error
Date: Sun, 19 Mar 2017 10:32:40 -0700	[thread overview]
Message-ID: <87cadaf74138965f72d0943a39cd266ba942b69c.1489944653.git.brian.avery@intel.com> (raw)
In-Reply-To: <cover.1489944653.git.brian.avery@intel.com>

We do a hard link to speed up sdk creation but if your sstate-cache is
across a file system boundary, this tries and fails. This patch catches
that error and does a copy instead.

Signed-off-by: brian avery <brian.avery@intel.com>
---
 scripts/gen-lockedsig-cache | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 49de74ed..6765891 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -62,7 +62,11 @@ for f in files:
         os.remove(dst)
     if (os.stat(src).st_dev == os.stat(destdir).st_dev):
         print('linking')
-        os.link(src, dst)
+        try:
+            os.link(src, dst)
+        except OSError as e:
+            print('hard linking failed, copying')
+            shutil.copyfile(src, dst)
     else:
         print('copying')
         shutil.copyfile(src, dst)
-- 
1.9.1



      reply	other threads:[~2017-03-19 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-19 17:32 [PATCH V3 0/1] gen-lockedsig-cache: catch os.link error brian avery
2017-03-19 17:32 ` brian avery [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cadaf74138965f72d0943a39cd266ba942b69c.1489944653.git.brian.avery@intel.com \
    --to=avery.brian@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.