Checking dependency

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

 



Hi,

I have a small script (attached) that I use to copy files from a
repository of all rpms to the directory from where I burn the CD.
basically what I intend to do is to make a single RedHat CD with all the
updates for a server class installation. For that I have trimmed the comps
file to remove the X and other unwanted stuff. My script (hopefully)
copies all the packages that are listed in the comps file to the destdir,
from where I burn the CD.

Now I want to add dependency check to this script, so that after copying
it will run the dependency check and will inform if their are any
problems.

The anaconda has a function to find out dependency problems, but I could
not figure out which. Any help here will be much appreciated.

raj

#
# copy.py
# Rajkumar S. <raj@xxxxxxxxxxxxx>
#
# Copyright 2002 Linuxense Information Systems Pvt. Ltd.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#


from os import *
from shutil import *
import rpm
from comps import * 

rpmpath = "/root/i386"
comppath = "/root/redhat/cdrom/RedHat/base/comps"
destpath = "/root/redhat/cdrom/RedHat/RPMS/"

fnames = {}
 
def readHeaders(rpmpath):
    hl = []
    for n in os.listdir(rpmpath):
        fd = os.open(rpmpath + "/" + n, 0)
        try:
            (h, isSource) = rpm.headerFromPackage(fd)
            if (h and not isSource):
                fnames[h[rpm.RPMTAG_NAME]] = n
                hl.append(h)
        except Exception, e:
            print "Some exception" + str (e)
        os.close(fd)
    return HeaderList(hl)
        
hdlist =  readHeaders("/root/i386")

cs = ComponentSet(comppath, hdlist);
#print len(cs.packages.list());
#print cs.expressions.items()
#print fnames.keys()

for pkg in cs.expressions.keys():
    rpmname =  fnames[str(pkg)]
    filename = rpmpath + '/' + rpmname
    #print filename
    copy (filename, destpath)

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux