Pungis work directory.

Joel Andres Granados jgranado at redhat.com
Tue Jun 5 17:27:16 UTC 2007


>
> I tested to see what would happen with each if the options (-G -B -P 
> -S -I)  and I found out that on G,B and I tracedback, in the other 
> options it didn't.  When I tested again (I don't know why I tested two 
> times), I found that the tracebacks where different in G, B and I.  So 
> basically the trace backs depend on the state of the directory.  If 
> the directory is in one state the traceback happens in one line, if it 
> is in another state it has the possibility of occurring in another.
> So I thought that the best way to fix it would be to check for the 
> existence of the directory in every directory creation,  so I looked 
> for every occurrence of "os.makedirs":
>
> /usr/lib/python2.5/site-packages/pypungi/gather.py:64:            
> os.makedirs(logdir)
> /usr/lib/python2.5/site-packages/pypungi/gather.py:275:            
> os.makedirs(pkgdir)
> /usr/lib/python2.5/site-packages/pypungi/gather.py:342:            
> os.makedirs(pkgdir)
> /usr/lib/python2.5/site-packages/pypungi/pungi.py:45:            
> os.makedirs(self.workdir)
> /usr/lib/python2.5/site-packages/pypungi/pungi.py:165:        
> os.makedirs(docsdir)
> /usr/lib/python2.5/site-packages/pypungi/pungi.py:263:                
> os.makedirs("%s-disc%d/SRPMS" % (timber.dist_dir, i))
> /usr/lib/python2.5/site-packages/pypungi/pungi.py:293:            
> os.makedirs('%s-disc1' % self.topdir)
> /usr/lib/python2.5/site-packages/pypungi/pungi.py:320:        
> os.makedirs(self.isodir)
> /usr/bin/pungi:90:            os.makedirs(destdir)
> /usr/bin/pungi:99:            os.makedirs(cachedir)
>

Actually more lines must be changed.  All the shutils lines that create 
a directory in one way or another have the potential to traceback with 
the "directory already exists" message.

> I just don't like it... IMO its just not right to check for the 
> existence of the directory in every line!!!
>
> So I take what I said in my last post back, and am sticking with the 
> "create a new root directory for each execution" solution.  I changed 
> it a little.  Instead of using time.time(), I used time.localtime()'s 
> elements.  So now the directory would be something like 
> "/srv/pungi/Fedora/2007-5-16-1430/..."  IMO it looks much better than 
> what time.time() spits out.
Considering the state of pungi in which it is separated by stages this 
^^^^^ solution is not really very useful :(.  An option in which the 
user selects the name of the tree he wants to use is needed (not pretty).
Came up with another solution that until now has pretty much solved the 
problem and has not broken pungi (in my tests).  The solutions simply 
clears any directory that pungi is going to create.  So for each line in 
which a directory is created I added a line to erase it.
The diff is attached.
Regards.

-- 
Joel Andres Granados

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffD
URL: <http://listman.redhat.com/archives/fedora-buildsys-list/attachments/20070605/99c2ac91/attachment.ksh>


More information about the Fedora-buildsys-list mailing list