#!/usr/bin/python
-import oe, string, sys
+import oe, string, sys, os
-import oedata # data handling
-oedata.init()
+import oe.data # data handling
+oe.data.init()
-import oeparse # file parsing
+import oe.parse # file parsing
def getBuildOrder(digraph):
refcount = 0
depcmd="stage"
files = []
-files.append("test.oe")
-files.append("conf/oe.conf")
+files.append("../packages/content/glibc-2.3.1.oe")
pkgdata = {}
-#cfgdata = oeparse.handle("../conf/oe.conf")
+#cfgdata = oe.parse.handle("../conf/oe.conf")
#from copy import copy
-#testdata = oeparse.handle("../test.oe", copy(cfgdata))
+#testdata = oe.parse.handle("../test.oe", copy(cfgdata))
+
+cfg = {}
+oe.parse.init(".conf", cfg)
+oe.data.inheritFromOS(1, cfg)
+
+__oepath_found_it__ = 0
+for s in oe.data.getVar('OEPATH', cfg).split(":"):
+ s = oe.data.expand(s, cfg)
+ if os.access(os.path.join(s,'conf/oe.conf'), os.R_OK):
+ __oepath_found_it__ = os.path.join(s, 'conf/oe.conf')
+
+if __oepath_found_it__ == 0:
+ oe.fatal("error locating conf/oe.conf")
+else:
+ cfg = oe.parse.handle(__oepath_found_it__, cfg) # Read configuration
+
+#oe.set_automatic_vars(sys.argv[2], ) # Deduce per-package environment variables
for f in files:
# read a file's metadata
try:
- pkgdata[f] = oeparse.handle(f)
- oedata.emit_env(sys.__stdout__, pkgdata[f])
-# print "pkgdata[\"%s\"]:" % f
-# print "\t %s" % pkgdata[f]
+ from copy import copy
+ pkgdata[f] = oe.parse.handle(f, copy(cfg))
+ if pkgdata[f] is not None:
+ oe.data.emit_env(sys.__stdout__, pkgdata[f])
except IOError:
pass
+
# use that metadata to yank the necessary bits for high
# level build process.. the depends fields and provides info
#test.addnode("glibc", None)
#test.addnode("ipkg", "glibc")
#data = getBuildOrder(test)
-
#for d in data:
# (pkg, step) = d
# print "oebuild %s %s-*.oe" % (step, pkg)