Jesse Keating wrote:
On Monday 12 February 2007 06:51, Essien Ita Essien wrote:
This is another small patch. What it does is breakup the pungi process
into different stages that can be invoked independently without going
thru all the stages. the stages are:

    - Gather (-G)
    - Buildinstall (-B)
    - Package Order (-P)
    - Splittree (-S)
    - Iso Creation (-I)

Hi, there is no patch attached...

DOH!!!
------------------------------------------------------------------------

--
Fedora-buildsys-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list

diff -r 7c7ab95a2d6e pungi
--- a/pungi	Mon Feb 12 12:15:48 2007 +0100
+++ b/pungi	Mon Feb 12 12:26:06 2007 +0100
@@ -23,7 +23,6 @@ def main():
     # Set some default variables, can be overrided in config file
 
     # Turn this into a dict someday, to iterate over when setting defaults
-    flavor = ""
     osdir = "os"
     sourcedir = "source"
     debugdir = "debug"
@@ -36,9 +35,6 @@ def main():
 
     config = SafeConfigParser()
     config.read(opts.config)
-
-    if not config.has_option('default', 'flavor'):
-        config.set('default', 'flavor', flavor)
 
     if not config.has_option('default', 'osdir'):
         config.set('default', 'osdir', osdir)
@@ -68,7 +64,7 @@ def main():
     if not config.has_option('default', 'iso_basename'):
         config.set('default', 'iso_basename', config.get('default', 'product_name'))
 
-    pkglist = get_packagelist(config.get('default', 'manifest'))
+    pkglist = get_packagelist(config.get('default', 'comps'))
 
     destdir = config.get('default', 'destdir')
 
@@ -90,20 +86,28 @@ def main():
 
     # Actually do work.
     if not config.get('default', 'arch') == 'source':
-        mygather = pypungi.gather.Gather(config, pkglist)
-        mygather.getPackageObjects()
-        mygather.downloadPackages()
-        if config.getboolean('default', 'getsource'):
-            mygather.getSRPMList()
-            mygather.downloadSRPMs()
+        if opts.do_all or opts.do_gather:
+            mygather = pypungi.gather.Gather(config, pkglist)
+            mygather.getPackageObjects()
+            mygather.downloadPackages()
+            if config.getboolean('default', 'getsource'):
+                mygather.getSRPMList()
+                mygather.downloadSRPMs()
 
         mypungi = pypungi.pungi.Pungi(config)
-        mypungi.doBuildinstall()
-        mypungi.doPackageorder()
-        mypungi.doGetRelnotes()
-        mypungi.doSplittree()
-        mypungi.doCreateSplitrepo()
-        mypungi.doCreateIsos()
+
+        if opts.do_all or opts.do_buildinstall:
+           mypungi.doBuildinstall()
+
+        if opts.do_all or opts.do_packageorder:
+           mypungi.doPackageorder()
+           mypungi.doGetRelnotes()
+
+        if opts.do_all or opts.do_splittree:
+             mypungi.doSplittree()
+        if opts.do_all or opts.do_createiso:
+           mypungi.doCreateSplitrepo()
+           mypungi.doCreateIsos()
 
     # Do things slightly different for src.
     if config.get('default', 'arch') == 'source':
@@ -111,7 +115,6 @@ def main():
         mypungi = pypungi.pungi.Pungi(config)
         mypungi.topdir = os.path.join(config.get('default', 'destdir'),
                                       config.get('default', 'version'),
-                                      config.get('default', 'flavor'),
                                       'source', 'SRPM')
         mypungi.doSplitSRPMs()
         mypungi.doCreateIsos()
@@ -143,25 +146,36 @@ if __name__ == '__main__':
         parser.add_option("-c", "--conf", default='/etc/pungi/pungi.conf', dest="config",
           help='Config file to use')
 
+        parser.add_option("--all-stages", action="store_true", default=True, dest="do_all", help="Enable ALL stages")
+        parser.add_option("-B", action="store_true", default=False, dest="do_buildinstall", help="Flag to enable processing the BuildInstall stage")
+        parser.add_option("-G", action="store_true", default=False, dest="do_gather", help="Flag to enable processing the Gather stage")
+        parser.add_option("-P", action="store_true", default=False, dest="do_packageorder", help="Flag to enable processing the Package Order stage")
+        parser.add_option("-S", action="store_true", default=False, dest="do_splittree", help="Flag to enable processing the SplitTree stage")
+        parser.add_option("-I", action="store_true", default=False, dest="do_createiso", help="Flag to enable processing the CreateISO stage")
+
 
 
         (opts, args) = parser.parse_args()
+        if opts.do_gather or opts.do_buildinstall or opts.do_packageorder or opts.do_splittree or opts.do_createiso:
+            opts.do_all = False
         #if len(opts) < 1:
         #    parser.print_help()
         #    sys.exit(0)
         return (opts, args)
 
-    def get_packagelist(manifest):
+    def get_packagelist(myComps):
     # Get the list of packages from the comps file
         try:
-            manifestfile = open(manifest, 'r')
+            compsobj = yum.comps.Comps()
+            compsobj.add(myComps)
 
         except IOError:
-            print >> sys.stderr, "pungi: No such file:\'%s\'" % manifest
+            print >> sys.stderr, "pungi: No such file:\'%s\'" % opts.comps
             sys.exit(1)
 
-        pkglist = [l.strip() for l in manifestfile.readlines()]
-        manifestfile.close()
+        pkglist = []
+        for group in compsobj.groups:
+            pkglist += group.packages
         return pkglist
 
     main()
--
Fedora-buildsys-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list

Reply via email to