raise EventException("", InvalidTask(task, d))
# check whether this task needs executing..
- if stamp_is_current(task, d):
- return 1
+ if not data.getVarFlag(task, 'force', d):
+ if stamp_is_current(task, d):
+ return 1
# follow digraph path up, then execute our way back down
def execute(graph, item):
oe.data.setVarFlag("PF", "warnlevel", "3", data)
oe.data.setVarFlag("S", "warnlevel", "3", data)
oe.data.setVarFlag("T", "warnlevel", "3", data)
+ oe.data.setVarFlag("D", "inherit", "1", data)
oe.data.setVarFlag("D", "warnlevel", "3", data)
oe.data.setVarFlag("A", "warnlevel", "3", data)
oe.data.setVarFlag("CATEGORY", "warnlevel", "2", data)
print "Example: oebuild build content/glibc-2.3.1.oe"
print ""
print " %s\t\t%s" % ("-v, --version", "output version information and exit")
+ print " %s\t\t%s" % ("-f, --force", "forces execution of specified task")
sys.exit(0)
__version__ = 1.0
import getopt
try:
- (opts, args) = getopt.getopt(sys.argv[1:], 'vh', [ 'version', 'help' ])
+ (opts, args) = getopt.getopt(sys.argv[1:], 'vhf', [ 'version', 'help', 'force' ])
except getopt.GetoptError:
usage(1)
data.setVarFlag(pcontent, 'deps', pdeps, oedata)
build.add_task(p, pcontent, pdeps)
+if '--force' in optsonly or '-f' in optsonly:
+ print "setting force flag"
+ data.setVarFlag('do_%s' % cmd, 'force', 1, oedata)
+
try:
build.exec_task('do_%s' % cmd, oedata)
except build.FuncFailed:
def usage():
print "Usage: oeinstall [options ...]"
print "Installs specified files of supported types into a root filesystem."
- print "Supported types: tar.gz, ipk, deb, rpm"
+ print "Currently only supports installing OEFILES into the rootfs directly"
+ print "using their do_install target."
print ""
print " %s\t\t%s" % ("-r [arg], --root [arg]", "root directory (default=${IMAGE_ROOTFS})")
- print " %s\t\t%s" % ("-f [arg], --files [arg]", "files to install (default=${INSTALL_FILES})")
+ print " %s\t\t%s" % ("-f [arg], --files [arg]", "files to install (default=${INSTALL_OEFILES})")
print " %s\t\t%s" % ("-v, --version", "output version information and exit")
sys.exit(0)
data.setVar('IMAGE_ROOTFS', rootfs, cfg_oe)
-files = string.split(data.getVar('INSTALL_FILES', cfg_oe, 1) or "")
-
-if opthash.has_key('--files'):
- files = opthash['--files'].split()
-if opthash.has_key('-f'):
- files = opthash['-f'].split()
-
-if not files:
- oe.fatal("install files not specified")
-
-data.setVar('INSTALL_FILES', files, cfg_oe)
-
# grab OEDIR
topdir = data.getVar('TOPDIR', cfg_oe, 1) or os.getcwd()
oedir = data.getVar('OEDIR', cfg_oe, 1) or topdir
mkdirhier(oedir)
-for f in files:
- oe.note("file is %s" % f)
+os.environ["D"] = rootfs
+oe.note("Spawning oemake to run do_install for each package.")
+ret = os.system('oemake --cmd install --force --abort')
+if ret != 0:
+ sys.exit(1)
+sys.exit(0)
command = cmd
debug(1, "oebuild %s %s" % (command, fn))
event.fire(PkgStarted(item, pkgdata[fn]))
- ret = os.system("oebuild %s %s" % (command, fn))
+ opts = ""
+ if force:
+ opts += " --force"
+ ret = os.system("oebuild %s %s %s" % (opts, command, fn))
if ret == 0:
event.fire(PkgSucceeded(item, pkgdata[fn]))
__build_cache.append(item)
print ""
print " %s\t\t%s" % ("-v, --version", "output version information and exit")
print " %s\t\t%s" % ("-c [arg], --cmd [arg]", "specify command to pass to oebuild")
+ print " %s\t\t%s" % ("-a, --abort", "abort build if any package build fails")
+ print " %s\t\t%s" % ("-f, --force", "force run of specified cmd, regardless of status")
sys.exit(0)
__version__ = 1.1
import getopt
try:
- (opts, args) = getopt.getopt(sys.argv[1:], 'vc:', [ 'version', 'cmd=' ])
+ (opts, args) = getopt.getopt(sys.argv[1:], 'vc:fa', [ 'version', 'cmd=', 'abort', 'force' ])
except getopt.GetoptError:
usage()
version()
sys.exit(0)
+if opthash.has_key('--abort') or opthash.has_key('-a'):
+ abort = 1
+else:
+ abort = 0
+
+if opthash.has_key('--force') or opthash.has_key('-f'):
+ force = 1
+else:
+ force = 0
+
if opthash.has_key('--cmd'):
cmd = opthash['--cmd']
if opthash.has_key('-c'):
_depcmds = { "clean": None,
"mrproper": None,
- "build": "stage", }
+ "build": "stage",
+ "install": None, }
if not cmd:
cmd = "build"
for pkg in pkgs.keys():
(deps, fn) = pkgs[pkg]
- if _depcmds[cmd] is not None:
+ if _depcmds.has_key(cmd) and _depcmds[cmd] is not None:
if deps is not None:
for d in deps:
if not graph.hasnode(d):
for k in packages:
if pkgs.has_key(k):
- graph.walkdown(k, build)
+ ret = graph.walkdown(k, build)
+ if abort and not ret:
+ oe.fatal("Build of %s failed, aborting." % k)
else:
oe.error("Unable to build %s: no .oe file provides it." % k)
+ if abort:
+ sys.exit(1)
event.fire(BuildCompleted(buildname, graph.okeys, cfg))
oe_runmake all
}
--or-
+or
do_install () {
oe_runmake 'PREFIX=${D}' install
}
-You get the picture. See $OEDIR/bin/classes/base.oeclass for an idea
+And so on. See $OEDIR/bin/classes/base.oeclass for an idea
as to what tasks exist by default, and what their default behaviors are.
The system will automatically assume that your .oe inherits base, in addition
to whatever oeclasses you inherit manually.