summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-02-23 17:00:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-24 17:41:42 +0000
commit67c1d2eeb7384abb307805a088eb63341ef09af1 (patch)
tree4c31ee10733eec1b31e7a5f977c2220870631a55
parent19e06e6584ab2aa31709bcf8fe7b566cafd297e7 (diff)
downloadpoky-67c1d2eeb7384abb307805a088eb63341ef09af1.tar.gz
gen-lockedsig-cache: Allow cross-filesystem copies.
Since this previously always tried to use hardlinks you couldn't have the source and destination be on different devices. This change allows for that and also prevents failure in situations where the files already existed. (From OE-Core rev: cf675896340ebed7c4830b93d791ddb08999031f) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/gen-lockedsig-cache10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index dfb282efd4..c93b2c0b99 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -35,6 +35,12 @@ for s in sigs:
35 35
36for f in files: 36for f in files:
37 dst = f.replace(sys.argv[2], sys.argv[3]) 37 dst = f.replace(sys.argv[2], sys.argv[3])
38 mkdir(os.path.dirname(dst)) 38 destdir = os.path.dirname(dst)
39 os.link(f, dst) 39 mkdir(destdir)
40 40
41 if os.path.exists(dst):
42 os.remove(dst)
43 if (os.stat(f).st_dev == os.stat(destdir).st_dev):
44 os.link(f, dst)
45 else:
46 shutil.copyfile(f, dst)