Hi list:

Pungi has a really cool characteristic that allows the user to specify the stage that he/she wants to execute. The stages are: Gather(-G), Buildinstall(-B), Package Order(-P), Splittree (-S) and createisos (-I). It is also implemented in a way that it creates the possibility for the user to specify non continuous stages (ex. pungi -G -I). This can make pungi behave in an unwanted way. To avoid this situation there is a patch attached that defines a range instead of individual stages. In other words if the user specifies `pungi -G -I` pungi will execute -G -B -P -S and -I. Moreover if the user specifies `pungi -G` only the gathering stage will be executed.

Another situation with the stages is that pungi does not verify if the stage that the user is specifying can be executed. So the user might execute the -I stage without having executed the -G stage (to say something stupid). IMO a function that at least checks if the directories that are needed are where they are suppose to be can be considered. Just a thought :)

Comments greatly appreciated :)
Regards.

--
Joel Andres Granados

diff -ur -x .hg pungi/pungi pungi_stages/pungi
--- pungi/pungi 2007-05-30 16:03:58.000000000 +0200
+++ pungi_stages/pungi  2007-05-30 17:56:14.000000000 +0200
@@ -101,7 +101,7 @@
 
     # Actually do work.
     if not config.get('default', 'arch') == 'source':
-        if opts.do_all or opts.do_gather:
+        if opts.do_gather:
             mygather = pypungi.gather.Gather(config, pkglist)
             mygather.getPackageObjects()
             mygather.downloadPackages()
@@ -111,17 +111,17 @@
 
         mypungi = pypungi.pungi.Pungi(config)
 
-        if opts.do_all or opts.do_buildinstall:
+        if opts.do_buildinstall:
            mypungi.doBuildinstall()
            mypungi.doGetRelnotes()
 
-        if opts.do_all or opts.do_packageorder:
+        if opts.do_packageorder:
            mypungi.doPackageorder()
 
-        if opts.do_all or opts.do_splittree:
+        if opts.do_splittree:
              mypungi.doSplittree()
 
-        if opts.do_all or opts.do_createiso:
+        if opts.do_createiso:
            mypungi.doCreateSplitrepo()
            mypungi.doCreateIsos()
 
@@ -133,10 +133,10 @@
                                       config.get('default', 'version'),
                                       config.get('default', 'flavor'),
                                       'source', 'SRPM')
-        if opts.do_all or opts.do_splittree:
+        if opts.do_splittree:
             mypungi.doSplitSRPMs()
 
-        if opts.do_all or opts.do_createiso:
+        if opts.do_createiso:
             mypungi.doCreateIsos()
 
 if __name__ == '__main__':
@@ -165,7 +165,29 @@
 
         (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
+            stMin = 0#Maximum stage
+            stMax = 4#Minimum stage
+            #chosen stages
+            choSt=[ opts.do_gather, opts.do_buildinstall, 
opts.do_packageorder, opts.do_splittree, opts.do_createiso ]
+
+            #Finding the minimum stage
+            for i in range(len(choSt)):
+                if choSt[i]:
+                   stMin = i
+                   break
+            #Finding the maximum stage
+            for i in range(len(choSt)):
+                if choSt[len(choSt)-1-i]:
+                    stMax = len(choSt)-1-i
+                    break
+            #Select what we are going to execute
+            for i in range(len(choSt)):
+                if i<stMin or i>stMax:choSt[i]=False
+                else:choSt[i]=True
+            
[opts.do_gather,opts.do_buildinstall,opts.do_packageorder,opts.do_splittree,opts.do_createiso]
 = choSt
+        else:
+            opts.do_gather = opts.do_buildinstall = opts.do_packageorder = 
opts.do_splittree = opts.do_createiso= True
+ 
         if len(sys.argv) < 2:
             parser.print_help()
             sys.exit(0)
--
Fedora-buildsys-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list

Reply via email to