aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-11-12 16:11:53 -0700
committerChris Larson <chris_larson@mentor.com>2010-11-12 16:13:10 -0700
commit81a5067e56df4bf7df435b8012836a04cabad424 (patch)
tree4e1f6fceb366127a294d68d64dedd2de708db51f /classes
parente0bcb3741e4306ce00e187ca2e0505efc5fe5d39 (diff)
downloadopenembedded-81a5067e56df4bf7df435b8012836a04cabad424.tar.gz
newcollection: handle globs in file: uris
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/newcollection.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/classes/newcollection.bbclass b/classes/newcollection.bbclass
index 20794f68bf..7d4d478491 100644
--- a/classes/newcollection.bbclass
+++ b/classes/newcollection.bbclass
@@ -40,6 +40,7 @@ def __newcollection_get_recipedeps(d):
def __newcollection_get_fileuris(d):
from urlparse import urlparse, urlunparse
+ from glob import glob
from os.path import isabs, join, exists
files = []
@@ -60,10 +61,16 @@ def __newcollection_get_fileuris(d):
except ValueError:
params = {}
- for fp in d.getVar("FILESPATH", 1).split(":"):
+ globbing = "*" in path
+ filespath = reversed(d.getVar("FILESPATH", True).split(":"))
+ for fp in filespath:
newpath = join(fp, path)
- if exists(newpath):
- files.append(newpath)
+ if globbing:
+ globbed = filter(lambda f: exists(f), glob(newpath))
+ files.extend(globbed)
+ else:
+ if exists(newpath):
+ files.append(newpath)
return files
@@ -77,14 +84,7 @@ def __newcollection_populate_file(src, dest, d):
if not exists(src):
return
- try:
- makedirs(dirname(dest))
- except OSError, e:
- if e.errno != EEXIST:
- bb.error("Unable to create %s:\n%s" % dirname(dest))
- bb.error(str(e))
- return
-
+ bb.mkdirhier(dirname(dest))
try:
if isdir(src):
copytree(src, dest, True)