Beispiel #1
0
    def _createDeps(
        self, productName, versionName, flavor=None, tag=None, recursive=False, exact=False, mapping=server.Mapping()
    ):
        """return a list of product dependencies for a given project.  This 
        function returns a proto-dependency list providing only as much 
        generic information as is possible without knowing the details of 
        how the data is organized on the server.  Thus, the dependency list
        will not include 
        """
        if flavor is None:
            flavor = self.flavor
        if tag is None:
            tag = self.tag
        productList = Manifest(productName, versionName, self.Eups, self.verbose - 1, log=self.log)

        # add a record for the top product
        productList.addDependency(productName, versionName, flavor, None, None, None, False)

        dependencies = None
        tablefile = None
        if self.noeups:
            if recursive and self.verbose > 0:
                print >>self.log, "Warning dependencies are not guaranteed", "to be recursive when using noeups option"

            def getTableFile(product, version, flavor):
                tablefile = self.findTableFile(product, version, flavor)
                # use the server as source of package information
                if not tablefile and self.distServer:
                    try:
                        tablefile = self.distServer.getTableFile(product, version, self.flavor)
                    except RemoteFileNotFound, e:
                        pass
                return tablefile

            tablefile = getTableFile(productName, versionName, self.flavor)
            if not tablefile:
                buildProduct, buildVersion = mapping.apply(productName, versionName, self.flavor)
                if buildProduct == productName and buildVersion != versionName:
                    tablefile = getTableFile(productName, buildVersion, self.flavor)

            if not tablefile and self.verbose > 0:
                print >>self.log, "Failed to find %s's table file; trying eups" % productName
Beispiel #2
0
    def _createDeps(self, productName, versionName, flavor=None, tag=None, 
                    recursive=False, exact=False, mapping=server.Mapping()):
        """return a list of product dependencies for a given project.  This 
        function returns a proto-dependency list providing only as much 
        generic information as is possible without knowing the details of 
        how the data is organized on the server.  Thus, the dependency list
        will not include 
        """
        if flavor is None:  flavor = self.flavor
        if tag is None:  tag = self.tag
        productList = Manifest(productName, versionName, self.Eups, self.verbose-1,
                               log=self.log)

        # add a record for the top product
        productList.addDependency(productName, versionName, flavor, None, None, None, False)

        dependencies = None
        tablefile = None
        if self.noeups:
            if recursive and self.verbose > 0:
                print >> self.log, "Warning dependencies are not guaranteed", \
                    "to be recursive when using noeups option"

            def getTableFile(product, version, flavor):
                tablefile = self.findTableFile(product, version, flavor)
                # use the server as source of package information
                if not tablefile and self.distServer:
                    try:
                        tablefile = self.distServer.getTableFile(product, version, self.flavor)
                    except RemoteFileNotFound, e:
                        pass
                return tablefile

            tablefile = getTableFile(productName, versionName, self.flavor)
            if not tablefile:
                buildProduct, buildVersion = mapping.apply(productName, versionName, self.flavor)
                if buildProduct == productName and buildVersion != versionName:
                    tablefile = getTableFile(productName, buildVersion, self.flavor)

            if not tablefile and self.verbose > 0:
                print >> self.log, "Failed to find %s's table file; trying eups" % productName
Beispiel #3
0
    def getManifest(self, product, version, flavor, noaction=False):
        if noaction:
            return Manifest()

        if version is None:
            raise RuntimeError("Unspecified version for %s" % product)

        tablefile = self.getTableFile(product, version, flavor)
        table = Table(tablefile)
        deps = table.dependencies(self.Eups, recursive=True)
        deps.reverse()

        manifest = Manifest(product, version)
        for p, optional, depth in deps:
            if not optional or self.Eups.findProduct(p.name, p.version):
                manifest.addDependency(p.name, p.version, p.flavor, None, None, None, optional)

        distId = "build:%s-%s.build" % (product, version)
        tableName = "%s.table" % product
        manifest.addDependency(product, version, flavor, tableName, os.path.join(product, version), distId, False)

        return manifest
Beispiel #4
0
    def getManifest(self, product, version, flavor, noaction=False):
        if noaction:
            return Manifest()

        if version is None:
            raise RuntimeError("Unspecified version for %s" % product)

        tablefile = self.getTableFile(product, version, flavor)
        table = Table(tablefile)
        deps = table.dependencies(self.Eups, recursive=True)
        deps.reverse()

        manifest = Manifest(product, version)
        for p, optional, depth in deps:
            if not optional or self.Eups.findProduct(p.name, p.version):
                manifest.addDependency(p.name, p.version, p.flavor, None, None,
                                       None, optional)

        distId = "build:%s-%s.build" % (product, version)
        tableName = "%s.table" % product
        manifest.addDependency(product, version, flavor, tableName,
                               os.path.join(product, version), distId, False)

        return manifest