summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-12-31 12:47:35 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-07 14:43:24 +0000
commitdb51e36b8e8c96d087d1223ec32f9ad62901ee6f (patch)
tree136a14aa20d77c643fe2ee2f1abb80f4745f54b7 /meta/classes
parentd05bc20b7945f3f71c9116c12e82cf1168814a05 (diff)
downloadpoky-db51e36b8e8c96d087d1223ec32f9ad62901ee6f.tar.gz
copyleft_compliance: grab the scm mirror tarballs
If the mirror tarball is available, it's a better choice for this than the repository directory. (From OE-Core rev: 8183962869363731acf57f2f531da737512f0f2f) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Gilbert Coville <gilbert_coville@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/copyleft_compliance.bbclass20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
index e68942d84c..786cf1e9c7 100644
--- a/meta/classes/copyleft_compliance.bbclass
+++ b/meta/classes/copyleft_compliance.bbclass
@@ -13,6 +13,7 @@ COPYLEFT_SOURCES_DIR ?= '${DEPLOY_DIR}/copyleft_sources'
13 13
14python do_prepare_copyleft_sources () { 14python do_prepare_copyleft_sources () {
15 """Populate a tree of the recipe sources and emit patch series files""" 15 """Populate a tree of the recipe sources and emit patch series files"""
16 import os.path
16 import shutil 17 import shutil
17 18
18 p = d.getVar('P', True) 19 p = d.getVar('P', True)
@@ -24,22 +25,27 @@ python do_prepare_copyleft_sources () {
24 bb.debug(1, 'copyleft: %s is included: %s' % (p, reason)) 25 bb.debug(1, 'copyleft: %s is included: %s' % (p, reason))
25 26
26 sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', True) 27 sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', True)
28 dl_dir = d.getVar('DL_DIR', True)
27 src_uri = d.getVar('SRC_URI', True).split() 29 src_uri = d.getVar('SRC_URI', True).split()
28 fetch = bb.fetch2.Fetch(src_uri, d) 30 fetch = bb.fetch2.Fetch(src_uri, d)
29 ud = fetch.ud 31 ud = fetch.ud
30 32
31 locals = (fetch.localpath(url) for url in fetch.urls)
32 localpaths = [local for local in locals if not local.endswith('.bb')]
33 if not localpaths:
34 return
35
36 pf = d.getVar('PF', True) 33 pf = d.getVar('PF', True)
37 dest = os.path.join(sources_dir, pf) 34 dest = os.path.join(sources_dir, pf)
38 shutil.rmtree(dest, ignore_errors=True) 35 shutil.rmtree(dest, ignore_errors=True)
39 bb.mkdirhier(dest) 36 bb.mkdirhier(dest)
40 37
41 for path in localpaths: 38 for u in ud.values():
42 os.symlink(path, os.path.join(dest, os.path.basename(path))) 39 local = os.path.normpath(fetch.localpath(u.url))
40 if local.endswith('.bb'):
41 continue
42
43 if u.mirrortarball:
44 tarball_path = os.path.join(dl_dir, u.mirrortarball)
45 if os.path.exists(tarball_path):
46 local = tarball_path
47
48 os.symlink(local, os.path.join(dest, os.path.basename(local)))
43 49
44 patches = src_patches(d) 50 patches = src_patches(d)
45 for patch in patches: 51 for patch in patches: