[Rpm-metadata] replacing os.chdir calls with basedir config option

Paul Nasrat pnasrat at redhat.com
Fri Nov 11 19:49:44 UTC 2005


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createrepo-basedir-fix.patch
Type: text/x-patch
Size: 844 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/rpm-metadata/attachments/20051111/7dfebc2f/attachment.bin 


More information about the Rpm-metadata mailing list