Пример #1
0
    def getPackageSource(self, channel, package, msgCallback = None, progressCallback = None):
        filename = package
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        if msgCallback:
            msgCallback(package)
            
        # interesting, yum doesnt seem to let you specify a path for the
        # source rpm...

        # Actually, it does now, but I need to download another meta data
        # file to do it, will do but not till .16 or so

        url = "%s/SRPMS/%s" % (channel['url'], filename)

               
        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(url, fd,
                                   progressCallback = progressCallback,
                                   agent = "Up2date %s/Yum" % up2dateUtils.version())
                                                                                
        fd.close()
        buffer = open(filePath, "r").read()
        
        return buffer
Пример #2
0
    def getPackageSource(self,
                         channel,
                         package,
                         msgCallback=None,
                         progressCallback=None):
        filename = package
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        if msgCallback:
            msgCallback(package)

        # interesting, yum doesnt seem to let you specify a path for the
        # source rpm...

        # Actually, it does now, but I need to download another meta data
        # file to do it, will do but not till .16 or so

        url = "%s/SRPMS/%s" % (channel['url'], filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url,
            fd,
            progressCallback=progressCallback,
            agent="Up2date %s/Yum" % up2dateUtils.version())

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer
Пример #3
0
    def getPackage(self, pkg, msgCallback = None, progressCallback = None):
        filename = "%s-%s-%s.%s.rpm" % (pkg[0], pkg[1], pkg[2],
                                        pkg[4])
        channels = rhnChannel.getChannels()
        channel = channels.getByLabel(pkg[6])

	#print "self.pkgNamePath: %s" % self.pkgNamePath
        #print "stored rpmpath: %s" % self.pkgNamePath[(pkg[0], pkg[1], pkg[2], pkg[3], pkg[4])]
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)
	#rpmPath = self.pkgNamePath[(pkg[0], pkg[1], pkg[2], pkg[3], pkg[4])]
        rpmPath = pkg[7]

        url = "%s/%s" % (channel['url'],rpmPath )
        if msgCallback:
            # for now, makes it easier to debug
            #msgCallback(url)
            msgCallback(filename)


            
        
        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(url, fd,
                                   progressCallback = progressCallback,
                                   agent = "Up2date %s/Yum" % up2dateUtils.version())
                                                                                
        fd.close()
        buffer = open(filePath, "r").read()
        
        return buffer
Пример #4
0
    def getPackage(self, pkg, msgCallback=None, progressCallback=None):
        filename = "%s-%s-%s.%s.rpm" % (pkg[0], pkg[1], pkg[2], pkg[4])
        channels = rhnChannel.getChannels()
        channel = channels.getByLabel(pkg[6])

        #print "self.pkgNamePath: %s" % self.pkgNamePath
        #print "stored rpmpath: %s" % self.pkgNamePath[(pkg[0], pkg[1], pkg[2], pkg[3], pkg[4])]
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)
        #rpmPath = self.pkgNamePath[(pkg[0], pkg[1], pkg[2], pkg[3], pkg[4])]
        rpmPath = pkg[7]

        url = "%s/%s" % (channel['url'], rpmPath)
        if msgCallback:
            # for now, makes it easier to debug
            #msgCallback(url)
            msgCallback(filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url,
            fd,
            progressCallback=progressCallback,
            agent="Up2date %s/Yum" % up2dateUtils.version())

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer
Пример #5
0
    def getPackage(self, package, msgCallback=None, progressCallback=None):
        filename = "%s-%s-%s.%s.rpm" % (package[0], package[1], package[2],
                                        package[4])
        channels = rhnChannel.getChannels()
        channel = channels.getByLabel(package[6])
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        # FIXME: apt has some more sophisticated logic for actually finding
        # the package that this, probabaly need to implement to support
        # most repos
        url = "%s/RPMS.%s/%s" % (channel['url'], channel['dist'], filename)

        if msgCallback:
            #DEBUG
            msgCallback(filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url,
            fd,
            progressCallback=progressCallback,
            agent="Up2date %s/Apt" % up2dateUtils.version())

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer
Пример #6
0
    def getPackageSource(self, channel, package, msgCallback=None, progressCallback=None):
        filename = package
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        if msgCallback:
            msgCallback(filename)
        url = "%s/SRPMS.%s/%s" % (channel["url"], channel["dist"], filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url, fd, progressCallback=progressCallback, agent="Up2date %s/Apt" % up2dateUtils.version()
        )

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer
Пример #7
0
    def getPackageSource(self,
                         channel,
                         package,
                         msgCallback=None,
                         progressCallback=None):
        filename = package
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        if msgCallback:
            msgCallback(filename)
        url = "%s/SRPMS.%s/%s" % (channel['url'], channel['dist'], filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url,
            fd,
            progressCallback=progressCallback,
            agent="Up2date %s/Apt" % up2dateUtils.version())

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer
Пример #8
0
    def getPackage(self, package, msgCallback=None, progressCallback=None):
        filename = "%s-%s-%s.%s.rpm" % (package[0], package[1], package[2], package[4])
        channels = rhnChannel.getChannels()
        channel = channels.getByLabel(package[6])
        filePath = "%s/%s" % (self.cfg["storageDir"], filename)

        # FIXME: apt has some more sophisticated logic for actually finding
        # the package that this, probabaly need to implement to support
        # most repos
        url = "%s/RPMS.%s/%s" % (channel["url"], channel["dist"], filename)

        if msgCallback:
            # DEBUG
            msgCallback(filename)

        fd = open(filePath, "w+")
        (lmtime) = urlUtils.fetchUrlAndWriteFD(
            url, fd, progressCallback=progressCallback, agent="Up2date %s/Apt" % up2dateUtils.version()
        )

        fd.close()
        buffer = open(filePath, "r").read()

        return buffer