import getopt
try:
- (opts, args) = getopt.getopt(sys.argv[1:], 'v', [ 'version' ])
+ (opts, args) = getopt.getopt(sys.argv[1:], 'vc:', [ 'version', 'cmd:' ])
except getopt.GetoptError:
usage()
# handle opts
optsonly = [ opt for (opt,val) in opts]
-if '--version' in optsonly or '-v' in optsonly:
+cmd = None
+
+def getopthash(l):
+ h = {}
+ for (opt, val) in l:
+ h[opt] = val
+ return h
+
+opthash = getopthash(opts)
+
+if opthash.has_key('--version') or opthash.has_key('-v'):
version()
sys.exit(0)
+if opthash.has_key('--cmd'):
+ cmd = opthash['--cmd']
+if opthash.has_key('-c'):
+ cmd = opthash['-c']
+
_depcmds = { "do_clean": None,
- "do_mrproper": None, }
+ "do_mrproper": None,
+ "do_build": "stage", }
-cmd="do_build"
+if not cmd:
+ cmd = "do_build"
if _depcmds.has_key(cmd):
- depcmd=depcmds[cmd]
+ depcmd=_depcmds[cmd]
else:
- depcmd="stage"
+ depcmd=cmd
pkgdata = {}
pkgs = {}
# grab oefiles
files = string.split(data.getVar("OEFILES", cfg, 1) or "")
-files += sys.argv[1:]
+files += args
data.setVar("OEFILES", string.join(files), cfg)
if not len(files):
for pkg in pkgs.keys():
(deps, fn) = pkgs[pkg]
- if deps is not None:
- for d in deps:
- if not graph.hasnode(d):
- def killitem(graph, item):
- global __tokill
- __tokill.append(item)
- graph.walkup(pkg, killitem)
- __unsatisfied.append([pkg, d])
- break
- graph.addnode(pkg, d)
+ if _depcmds[cmd] is not None:
+ if deps is not None:
+ for d in deps:
+ if not graph.hasnode(d):
+ def killitem(graph, item):
+ global __tokill
+ __tokill.append(item)
+ graph.walkup(pkg, killitem)
+ __unsatisfied.append([pkg, d])
+ break
+ graph.addnode(pkg, d)
for u in __unsatisfied:
event.fire(UnsatisfiedDep(u[0], pkgdata[pkgs[u[0]][1]], u[1]))
[x] Allow execution with a command, without .oe
[x] Allow execution with .oe, without command
[x] Default .oe argument for oemake
- [ ] Allow specifying a command on oemake execution
+ [x] Allow specifying a command on oemake execution
[ ] Must be able to execute 'oemake' within a subpackage
of an upstream package, and yet retain access to the
toplevel TMPDIR. Perhaps specify TMPDIR through