summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-12-22 17:02:59 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-28 09:25:13 +0000
commite78a03980ae2799cb8eaf4ecaf96697cc5395104 (patch)
tree01bb045c4de4ee6b99faf578441acb84469007c6 /scripts
parente61645b50417032bf5f79ef4bf1b1b622628890c (diff)
downloadpoky-e78a03980ae2799cb8eaf4ecaf96697cc5395104.tar.gz
recipetool: create: prevent attempting to unpack entire DL_DIR
If you specify a URL ending in /, BitBake's fetcher returns a localpath of ${DL_DIR}, and if you then try to unpack that it will attempt to copy the entire DL_DIR contents to the destination - which at least on my system filled my entire /tmp. Obviously we should fix the fetcher, but at least detect and stop that from happening here for now. (From OE-Core rev: 7e63a672517518644a37ce006e05b5494c29cf6e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/scriptutils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 4dd7ef2a0d..69e76d8ea2 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -86,6 +86,10 @@ def fetch_uri(d, uri, destdir, srcrev=None):
86 ud = fetcher.ud[u] 86 ud = fetcher.ud[u]
87 ud.ignore_checksums = True 87 ud.ignore_checksums = True
88 fetcher.download() 88 fetcher.download()
89 for u in fetcher.ud:
90 ud = fetcher.ud[u]
91 if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR', True).rstrip(os.sep):
92 raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
89 fetcher.unpack(destdir) 93 fetcher.unpack(destdir)
90 for u in fetcher.ud: 94 for u in fetcher.ud:
91 ud = fetcher.ud[u] 95 ud = fetcher.ud[u]