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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


ulockmgr_server
  /bin/ulockmgr_server from fuse
  /usr/bin/ulockmgr_server from fuse

telnet
  /usr/bin/telnet from telnet
  /usr/kerberos/bin/telnet from krb5-workstation-clients

gzip
  /bin/gzip from gzip
  /usr/bin/gzip from gzip

fusermount
  /bin/fusermount from fuse
  /usr/bin/fusermount from fuse

stap-env
  /usr/bin/stap-env from systemtap-client
  /usr/bin/stap-env from systemtap
  /usr/bin/stap-env from systemtap-server

winemaker
  /usr/bin/winemaker from wine-devel
  /usr/bin/winemaker from wine-common

ftp
  /usr/bin/ftp from ftp
  /usr/kerberos/bin/ftp from krb5-workstation-clients

pinentry
  /usr/bin/pinentry from pinentry
  /usr/bin/pinentry from pinentry-gtk
  /usr/bin/pinentry from pinentry-qt

kadmin
  /usr/kerberos/bin/kadmin from krb5-workstation-servers
  /usr/kerberos/bin/kadmin from krb5-workstation

lzcmp
  /usr/bin/lzcmp from xz-lzma-compat
  /usr/bin/lzcmp from lzma

lzgrep
  /usr/bin/lzgrep from xz-lzma-compat
  /usr/bin/lzgrep from lzma

lzdiff
  /usr/bin/lzdiff from xz-lzma-compat
  /usr/bin/lzdiff from lzma

lzcat
  /usr/bin/lzcat from xz-lzma-compat
  /usr/bin/lzcat from lzma

lzmainfo
  /usr/bin/lzmainfo from xz-lzma-compat
  /usr/bin/lzmainfo from lzma

lzfgrep
  /usr/bin/lzfgrep from xz-lzma-compat
  /usr/bin/lzfgrep from lzma

plymouth
  /bin/plymouth from plymouth
  /usr/bin/plymouth from plymouth

gawk
  /bin/gawk from gawk
  /usr/bin/gawk from gawk

ex
  /bin/ex from vim-minimal
  /usr/bin/ex from vim-enhanced

ircd
  /usr/bin/ircd from ircd-ratbox
  /usr/bin/ircd from ircd-hybrid

cut
  /bin/cut from coreutils
  /usr/bin/cut from coreutils

towhee-mpi
  /usr/bin/towhee-mpi from towhee-mpi
  /usr/bin/towhee-mpi from towhee

pscp
  /usr/bin/pscp from putty
  /usr/bin/pscp from pssh

links
  /usr/bin/links from links
  /usr/bin/links from elinks

rsh
  /usr/kerberos/bin/rsh from krb5-workstation-clients
  /usr/bin/rsh from rsh

awk
  /bin/awk from gawk
  /usr/bin/awk from gawk

tmda-ofmipd
  /usr/bin/tmda-ofmipd from tmda-ofmipd
  /usr/bin/tmda-ofmipd from tmda

kvno
  /usr/kerberos/bin/kvno from krb5-workstation-servers
  /usr/kerberos/bin/kvno from krb5-workstation

sclient
  /usr/kerberos/bin/sclient from krb5-devel
  /usr/kerberos/bin/sclient from krb5-server

unlzma
  /usr/bin/unlzma from xz-lzma-compat
  /usr/bin/unlzma from lzma

ktutil
  /usr/kerberos/bin/ktutil from krb5-workstation-servers
  /usr/kerberos/bin/ktutil from krb5-workstation

lzegrep
  /usr/bin/lzegrep from xz-lzma-compat
  /usr/bin/lzegrep from lzma

ntfs-3g
  /bin/ntfs-3g from ntfs-3g
  /usr/bin/ntfs-3g from ntfs-3g

k5srvutil
  /usr/kerberos/bin/k5srvutil from krb5-workstation-servers
  /usr/kerberos/bin/k5srvutil from krb5-workstation

rlogin
  /usr/kerberos/bin/rlogin from krb5-workstation-clients
  /usr/bin/rlogin from rsh

stap-find-servers
  /usr/bin/stap-find-servers from systemtap-client
  /usr/bin/stap-find-servers from systemtap-server

lzma
  /usr/bin/lzma from xz-lzma-compat
  /usr/bin/lzma from lzma

kde4-doxygen.sh
  /usr/bin/kde4-doxygen.sh from kdelibs-devel
  /usr/bin/kde4-doxygen.sh from kdelibs

find
  /bin/find from findutils
  /usr/bin/find from findutils

jasper5-setclasspath.sh
  /usr/bin/jasper5-setclasspath.sh from tomcat5
  /usr/bin/jasper5-setclasspath.sh from tomcat5-jasper

translate
  /usr/bin/translate from libtranslate
  /usr/bin/translate from surfraw

stap-gen-cert
  /usr/bin/stap-gen-cert from systemtap
  /usr/bin/stap-gen-cert from systemtap-server

stap-authorize-cert
  /usr/bin/stap-authorize-cert from systemtap
  /usr/bin/stap-authorize-cert from systemtap-server

rcp
  /usr/kerberos/bin/rcp from krb5-workstation-clients
  /usr/kerberos/bin/rcp from krb5-workstation-servers
  /usr/bin/rcp from rsh

env
  /bin/env from coreutils
  /usr/bin/env from coreutils

jspc5.sh
  /usr/bin/jspc5.sh from tomcat5
  /usr/bin/jspc5.sh from tomcat5-jasper

synergyc
  /usr/bin/synergyc from synergy
  /usr/bin/synergyc from synergy-plus

synergys
  /usr/bin/synergys from synergy
  /usr/bin/synergys from synergy-plus

xemacs
  /usr/bin/xemacs from xemacs-nox
  /usr/bin/xemacs from xemacs

kill
  /bin/kill from util-linux-ng
  /usr/bin/kill from util-linux-ng

gettext
  /bin/gettext from gettext
  /usr/bin/gettext from gettext

winedump
  /usr/bin/winedump from wine-core
  /usr/bin/winedump from wine-devel

ntfsmount
  /bin/ntfsmount from ntfs-3g
  /usr/bin/ntfsmount from ntfs-3g

slideshow
  /usr/bin/slideshow from plt-scheme
  /usr/bin/slideshow from batik-slideshow

stap-report
  /usr/bin/stap-report from systemtap-runtime
  /usr/bin/stap-report from systemtap

gunzip
  /bin/gunzip from gzip
  /usr/bin/gunzip from gzip

servlink
  /usr/bin/servlink from ircd-ratbox
  /usr/bin/servlink from ircd-hybrid

lzless
  /usr/bin/lzless from xz-lzma-compat
  /usr/bin/lzless from lzma

jasper5.sh
  /usr/bin/jasper5.sh from tomcat5
  /usr/bin/jasper5.sh from tomcat5-jasper

lzmore
  /usr/bin/lzmore from xz-lzma-compat
  /usr/bin/lzmore from lzma

lzmadec
  /usr/bin/lzmadec from xz-lzma-compat
  /usr/bin/lzmadec from lzma


[1]
http://archive.linux.duke.edu/pub/fedora/linux/development/i386/os/repodata/7f2a765f27d259bfcda52089e93209f5a36335a5f4cced069f856403dba22c75-filelists.xml.gz

# Script to parse a yum "filelist.xml.gz" and locate conflicting-named
# files installed into PATH

import os
import sys

filenames = {}

path_dirs = os.environ['PATH'].split(':') # FIXME: use defaults, rather than this user's PATH

from lxml import etree
tree = etree.parse('filelists.xml.gz')
filelists = tree.getroot()
for pkg in filelists.iter('{http://linux.duke.edu/metadata/filelists}package'):
    for file in pkg.iter('{http://linux.duke.edu/metadata/filelists}file'):
        path = file.text
        (directory, filename) = os.path.split(path)
        if directory not in path_dirs:
            continue
        if filename in filenames:
            filenames[filename].append( (path, pkg) )
        else:
            filenames[filename] = [ (path, pkg) ]
            
for filename, occurrences in filenames.iteritems():
    if len(occurrences)>1:
        print filename
        for (path, pkg) in occurrences:
            print '  %s from %s' % (path, pkg.get('name'))
        print
-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux