Re: replacing os.chdir calls with basedir config option

Dennis Gregorovic <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
On Fri, 2005-11-11 at 14:49 -0500, Paul Nasrat wrote:
> On Fri, 2005-11-11 at 13:33 -0500, Dennis Gregorovic wrote:
> > On Fri, 2005-11-11 at 13:17 -0500, Paul Nasrat wrote:
> > > On Fri, 2005-11-11 at 08:44 -0500, Dennis Gregorovic wrote:
> > > > I've started using createrepo as a library instead of a standalone app.
> > > > The only issue that I've run into so far is that the os.chdir() calls
> > > > can cause problems, especially if you have multiple threads using
> > > > createrepo in parallel.
> > > > 
> > > > Attached is a patch that removes the os.chdir() calls and introduces a
> > > > 'basedir' config option, settable with --basedir and defaulting to
> > > > os.getcwd().
> 
> > Hopefully this patch is better.  I have emacs set up to automatically
> > remove tabs and trailing whitespace, so I normally diff -w, but that may
> > have screwed up the first patch.
> 
> Patch is much better thanks, however I've noticed you've changed
> behaviour slightly.
> 
> tmp/myrepo/Fedora/RPMS/...
> tmp/rpm/foo.rpm (#broken package)
> 
> If I'm in tmp/
> 
> python ~/scm/duke/metadata/generate/genpkgmetadata.py myrepo
> fails when parsing the broken package, where as createrepo correctly
> succeeds.
> 
> Fix below.
> 
> Paul

Thank you for catching that.  Your fix looks good.

-- Dennis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.