(no commit message)
authorChris Larson <clarson@kergoth.com>
Mon, 22 Sep 2003 16:43:59 +0000 (16:43 +0000)
committerChris Larson <clarson@kergoth.com>
Mon, 22 Sep 2003 16:43:59 +0000 (16:43 +0000)
bin/oe/build.py
bin/oe/parse/ConfHandler.py
bin/oebuild
bin/oeinstall
bin/oemake
doc/DEVEL

index c4072b9..b09c608 100644 (file)
@@ -227,8 +227,9 @@ def exec_task(task, d):
                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):
index 399f50e..44c85f5 100644 (file)
@@ -117,6 +117,7 @@ def init(data):
        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)
index 8c3e1cc..ad2be34 100644 (file)
@@ -20,6 +20,7 @@ def usage(errorlevel=0, txt=''):
        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
@@ -29,7 +30,7 @@ def version():
 
 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)
 
@@ -171,6 +172,10 @@ for var in oedata.keys():
                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:
index 7c6bead..054d829 100644 (file)
@@ -9,10 +9,11 @@ cfg_oe = data.init()
 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)
 
@@ -61,22 +62,14 @@ if not rootfs:
 
 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)
index e5f609a..aca7e11 100644 (file)
@@ -112,7 +112,10 @@ def build(graph, item):
        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)
@@ -134,6 +137,8 @@ def usage():
        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
@@ -161,7 +166,7 @@ def get_oefile():
 
 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()
 
@@ -181,6 +186,16 @@ if opthash.has_key('--version') or opthash.has_key('-v'):
        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'):
@@ -188,7 +203,8 @@ if opthash.has_key('-c'):
 
 _depcmds = { "clean": None,
             "mrproper": None,
-            "build": "stage", }
+            "build": "stage",
+            "install": None, }
 
 if not cmd:
        cmd = "build"
@@ -288,7 +304,7 @@ for pkg in pkgs.keys():
 
 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):
@@ -313,8 +329,12 @@ packages = args or graph.okeys
 
 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))
index f2768d5..cfaccd5 100644 (file)
--- a/doc/DEVEL
+++ b/doc/DEVEL
@@ -38,13 +38,13 @@ any way, you can override any of the steps.  For example:
                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.