Bug 969754 - Createrepo sees multiply copies of each rpm file
Summary: Createrepo sees multiply copies of each rpm file
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: createrepo
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-02 07:40 UTC by Ronen Angluster
Modified: 2013-06-03 09:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-03 09:06:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ronen Angluster 2013-06-02 07:40:21 UTC
Description of problem:
When running createrepo on a directory which contains a soft symbolic link 
to the same directory, createrepo will claim that for each rpm in the directory there are infact 41 copies of the said rpm file.

Version-Release number of selected component (if applicable):
Crearerepo v0.9.8

How reproducible:
create a sybolic link to self and run crearerepo

Steps to Reproduce:
1. mkdir /tmp/repo
2. ln -s /tmp/repo /tmp/repo/foo
3. copy a single rpm file to /tmp/repo
4. cd /tmp/repo && createrepo .
5. marvel at your multi-dimensioned rpm file!

Actual results:
on a repository of 3k packages the metadata was of 120k packages.

Expected results:
know when thy art looped unto thy self.

Additional info:

Comment 1 Zdeněk Pavlas 2013-06-03 09:06:39 UTC
> ln -s /tmp/repo /tmp/repo/foo

Yep, that's a directory cycle.  Please don't do that.

> createrepo will claim that for each rpm in the directory there are infact 41 copies of the said rpm file.

While, in fact, there are infinitely many such copies.  The only reason this does not fail with an error is this interesting feature/bug:

$ python -c 'import os;print os.path.isdir("repo" + "/foo"*40)'
True
$ python -c 'import os;print os.path.isdir("repo" + "/foo"*41)'
False

Comment 2 Ronen Angluster 2013-06-03 09:18:38 UTC
great. that's a lousy answer. you're just saying "the user is doing something wrong but i wont protect myself against it".
baaaaad code writing.


Note You need to log in before you can comment on or make changes to this bug.