support "oemake --world" as a (preferred) alternative for "oemake world".
authorPhil Blundell <philb@gnu.org>
Sat, 4 Dec 2004 11:45:11 +0000 (11:45 +0000)
committerPhil Blundell <philb@gnu.org>
Sat, 4 Dec 2004 11:45:11 +0000 (11:45 +0000)
bin/oemake

index c44d5cd..be51a2d 100644 (file)
@@ -74,6 +74,9 @@ Default OEFILES are the .oe files in the current directory.""" )
     parser.add_option( "-s", "--show-versions", help = "show current and preferred versions of all packages",
                action = "store_true", dest = "show_versions", default = False )
 
+    parser.add_option( "--world", help = "build all available packages",
+               action = "store_true", dest = "build_world", default = False )
+
     options, args = parser.parse_args( args )
     return options, args[1:]
 
@@ -487,26 +490,27 @@ def build_depgraph():
         sys.stdout.write("\n")
 
     # Build package list for "oemake world"
-    oe.debug(1, "OEMAKE collating packages for \"world\"")
-    for f in make.pkgdata.keys():
-        d = make.pkgdata[f]
-        if oe.data.getVar('BROKEN', d, 1) or oe.data.getVar('EXCLUDE_FROM_WORLD', d, 1):
-            oe.debug(2, "OEMAKE skipping %s due to BROKEN/EXCLUDE_FROM_WORLD" % f)
-            continue
-        terminal = True
-        pn = oe.data.getVar('PN', d, 1)
-        for p in pn_provides[pn]:
-            if p.startswith('virtual/'):
-                oe.debug(2, "OEMAKE skipping %s due to %s provider starting with virtual/" % (f, p))
-                terminal = False
-                break
-            for pf in providers[p]:
-                if oe.data.getVar('PN', make.pkgdata[pf], 1) != pn:
-                    oe.debug(2, "OEMAKE skipping %s due to both us and %s providing %s" % (f, pf, p))
+    if make.options.build_world:
+        oe.debug(1, "OEMAKE collating packages for \"world\"")
+        for f in make.pkgdata.keys():
+            d = make.pkgdata[f]
+            if oe.data.getVar('BROKEN', d, 1) or oe.data.getVar('EXCLUDE_FROM_WORLD', d, 1):
+                oe.debug(2, "OEMAKE skipping %s due to BROKEN/EXCLUDE_FROM_WORLD" % f)
+                continue
+            terminal = True
+            pn = oe.data.getVar('PN', d, 1)
+            for p in pn_provides[pn]:
+                if p.startswith('virtual/'):
+                    oe.debug(2, "OEMAKE skipping %s due to %s provider starting with virtual/" % (f, p))
                     terminal = False
                     break
-        if terminal:
-            __world_target.add(pn)
+                for pf in providers[p]:
+                    if oe.data.getVar('PN', make.pkgdata[pf], 1) != pn:
+                        oe.debug(2, "OEMAKE skipping %s due to both us and %s providing %s" % (f, pf, p))
+                        terminal = False
+                        break
+            if terminal:
+                __world_target.add(pn)
 
 def myProgressCallback( x, y, f ):
     if oedebug > 0:
@@ -597,10 +601,15 @@ if __name__ == "__main__":
             oepkgs = oe.data.getVar('OEPKGS', make.cfg, 1)
             if oepkgs:
                     pkgs_to_build = oepkgs.split()
-    if not pkgs_to_build and not make.options.show_versions:
-            print "Nothing to build. Use 'oemake world' to build everything."
+    if not pkgs_to_build and not make.options.show_versions and not make.options.build_world:
+            print "Nothing to build. Use \"oemake --world\" to build everything."
             sys.exit(0)
 
+    if pkgs_to_build and 'world' in pkgs_to_build:
+        oe.note("use \"oemake --world\", not \"oemake world\"")
+        pkgs_to_build.remove('world')
+        make.options.build_world = True
+
     __stats["attempt"] = 0
     __stats["success"] = 0
     __stats["fail"] = 0
@@ -633,9 +642,9 @@ if __name__ == "__main__":
         if make.options.show_versions:
             showVersions()
             sys.exit(0)
-            
-        if 'world' in pkgs_to_build:
-            pkgs_to_build.remove('world')
+
+        if make.options.build_world:
+            pkgs_to_build = []
             for t in __world_target:
                 pkgs_to_build.append(t)