return deps
def base_read_file(filename):
+ import oe
try:
f = file( filename, "r" )
except IOError, reason:
- return "<unknown>:%s" % reason
+ raise oe.build.FuncFailed("can't read from file '%s' (%s)", (filename,reason))
else:
return f.read().strip()
return None
DEPENDS_prepend="${@base_dep_prepend(d)} "
-def base_set_filespath(d):
+def base_set_filespath(path, d):
import os, oe
filespath = []
- for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
+ for p in path:
overrides = oe.data.getVar("OVERRIDES", d, 1) or ""
overrides = overrides + ":"
for o in overrides.split(":"):
filespath.append(os.path.join(p, o))
oe.data.setVar("FILESPATH", ":".join(filespath), d)
-FILESPATH = "${@base_set_filespath(d)}"
+FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
+
+def oe_filter(f, str, d):
+ from re import match
+ return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+
+def oe_filter_out(f, str, d):
+ from re import match
+ return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
die() {
oefatal "$*"
efile = local
efile = oe.data.expand(efile, d)
patches_dir = oe.data.expand(oe.data.getVar('PATCHES_DIR', d), d)
- oe.mkdirhier(patches_dir)
+ oe.mkdirhier(patches_dir + "/.patches")
os.chdir(patches_dir)
cmd = "PATH=\"%s\" patcher" % oe.data.getVar("PATH", d, 1)
if "pnum" in parm:
cmd += " -p %s" % parm["pnum"]
- cmd += " -n \"%s\" -i %s" % (os.path.basename(efile), efile)
+ # Getting rid of // at the front helps the Cygwin-Users of OE
+ if efile.startswith('//'):
+ efile = efile[1:]
+ cmd += " -R -n \"%s\" -i %s" % (os.path.basename(efile), efile)
ret = os.system(cmd)
if ret != 0:
raise oe.build.FuncFailed("'patcher' execution failed")
cmd = 'bzip2 -dc %s > %s' % (local, efile)
elif local.endswith('.zip'):
loc = local.rfind('.')
- cmd = 'unzip %s' % local
+ cmd = 'unzip -q %s' % local
elif os.path.isdir(local):
filesdir = os.path.realpath(oe.data.getVar("FILESDIR", localdata, 1))
destdir = "."
cmd = 'cp %s %s/%s/' % (local, os.getcwd(), destdir)
if not cmd:
continue
+ cmd = "PATH=\"%s\" %s" % (oe.data.getVar('PATH', d, 1), cmd)
oe.note("Unpacking %s to %s/" % (local, os.getcwd()))
ret = os.system(cmd)
if ret != 0:
python read_shlibdeps () {
packages = (oe.data.getVar('PACKAGES', d, 1) or "").split()
for pkg in packages:
+ rdepends = explode_deps(oe.data.getVar('RDEPENDS_' + pkg, d, 0) or oe.data.getVar('RDEPENDS', d, 0) or "")
shlibsfile = oe.data.expand("${WORKDIR}/install/" + pkg + ".shlibdeps", d)
if os.access(shlibsfile, os.R_OK):
fd = file(shlibsfile)
lines = fd.readlines()
fd.close()
- rdepends = explode_deps(oe.data.getVar('RDEPENDS_' + pkg, d, 1) or oe.data.getVar('RDEPENDS', d, 1) or "")
for l in lines:
rdepends.append(l.rstrip())
- oe.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
+ pcfile = oe.data.expand("${WORKDIR}/install/" + pkg + ".pcdeps", d)
+ if os.access(pcfile, os.R_OK):
+ fd = file(pcfile)
+ lines = fd.readlines()
+ fd.close()
+ for l in lines:
+ rdepends.append(l.rstrip())
+ oe.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
}
python read_subpackage_metadata () {
pn = oe.data.getVar('PN', d, 1)
cvsdate = oe.data.getVar('CVSDATE_%s' % pn, d, 1)
- if cvsdate:
+ if cvsdate != None:
oe.data.setVar('CVSDATE', cvsdate, d)
try: