Script to detect conflicting files in PATH within a yum repo (was Re: conflict between libotf and openmpi)

Seth Vidal skvidal at fedoraproject.org
Thu Sep 17 18:14:22 UTC 2009



On Thu, 17 Sep 2009, David Malcolm wrote:

> On Thu, 2009-09-17 at 09:57 -0400, Seth Vidal wrote:
>>
>> On Wed, 16 Sep 2009, David Malcolm wrote:
>>
>>> On Wed, 2009-09-16 at 18:45 -0400, Neal Becker wrote:
>>>> Which makes me wonder, how could this conflict have been avoided?  Is there
>>>> a tool that would check any new package to see if any object* in it would
>>>> conflict with any existing package?  If not, sounds like a good thing to
>>>> have.
>>>>
>>>> * Here, object means filesystem object.  I'm not sure if there are any other
>>>> types of objects to worry about.
>>> Brainstorming: a script that walks the yum repo's filelist.tar.gz, and
>>> figures out a list of filename collisions, filtering by directories in
>>> the default PATH
>>>
>>>
>>> Attached is a first pass at a python script that does this.
>>>
>>> Output from the script when run upon [1] is below.  Caveat: the script
>>> probably has bugs.
>>>
>>> Does this look useful?
>>
>> David,
>>   Yes it does look useful.
>>
>> I wrote something similar:
>>
>> http://skvidal.fedorapeople.org/misc/potential_conflict.py
>>
>> which is what I believe autoqa is starting from for their file conflict
>> checker.
> Aha!  Your approach looks superior, as you're leveraging all that extra
> info from the RPM headers about file hashes etc.  Thanks.
>

maybe a bit more thourough but I wouldn't call it superior - it takes 
forever to complete b/c you have to look at all those headers :(

Magic alternatives welcome.

Actually, I sometimes wonder if we could do like git does and only take 
the first segment from the file's checksum and store it somewhere maybe 
with the other filelist sqlite metadata. That way we could tell if we were 
likely or unlikely to hit a conflict.

it is certainly not foolproof but I bet we'd be able to tell if two files 
were most likely different and occupying the same path in what? 85% of the 
cases? maybe more than that.

-sv




More information about the devel mailing list