summaryrefslogtreecommitdiff
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:38:01 +0000
commit8183962869363731acf57f2f531da737512f0f2f (patch)
treef9f61703b6abb4d340783501903f2f3c65c3a55b
parent6b437bf245e21fea2a792ebc3919ef4e42b0283f (diff)
downloadopenembedded-core-8183962869363731acf57f2f531da737512f0f2f.tar.gz
openembedded-core-8183962869363731acf57f2f531da737512f0f2f.tar.bz2
openembedded-core-8183962869363731acf57f2f531da737512f0f2f.zip
copyleft_compliance: grab the scm mirror tarballs
If the mirror tarball is available, it's a better choice for this than the repository directory. 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>
-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'
python do_prepare_copyleft_sources () {
"""Populate a tree of the recipe sources and emit patch series files"""
+ import os.path
import shutil
p = d.getVar('P', True)
@@ -24,22 +25,27 @@ python do_prepare_copyleft_sources () {
bb.debug(1, 'copyleft: %s is included: %s' % (p, reason))
sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', True)
+ dl_dir = d.getVar('DL_DIR', True)
src_uri = d.getVar('SRC_URI', True).split()
fetch = bb.fetch2.Fetch(src_uri, d)
ud = fetch.ud
- locals = (fetch.localpath(url) for url in fetch.urls)
- localpaths = [local for local in locals if not local.endswith('.bb')]
- if not localpaths:
- return
-
pf = d.getVar('PF', True)
dest = os.path.join(sources_dir, pf)
shutil.rmtree(dest, ignore_errors=True)
bb.mkdirhier(dest)
- for path in localpaths:
- os.symlink(path, os.path.join(dest, os.path.basename(path)))
+ for u in ud.values():
+ local = os.path.normpath(fetch.localpath(u.url))
+ if local.endswith('.bb'):
+ continue
+
+ if u.mirrortarball:
+ tarball_path = os.path.join(dl_dir, u.mirrortarball)
+ if os.path.exists(tarball_path):
+ local = tarball_path
+
+ os.symlink(local, os.path.join(dest, os.path.basename(local)))
patches = src_patches(d)
for patch in patches: