Exemple #1
0
    def updateDependencies(self, productList, flavor=None, mapping=server.Mapping()):
        """fill in information in the list of product dependencies based
        on what is known from the system

        This implementation will iterate through the products, adding the
        name of the table file and the distId.

        @param productList     list of products (output from createDependencies)
        @param flavor          the flavor of the target platform; this may 
                                 be ignored by the implentation
        @param mapping         mapping from desired product,version to existent product,version
        """
        for prod in productList:
            if prod.flavor is None:
                prod.flavor = flavor
            if prod.distId is None:
                prod.distId = self.getDistIdForPackage(prod.product, prod.version, prod.flavor)
            #
            # Find product's table file
            #


            def searchForTableFile(product, version, flavor):
                try:
                    return self.Eups.getProduct(product, version).tablefile
                except KeyboardInterrupt:
                    raise RuntimeError, ("You hit ^C while looking for %s %s's table file" %
                                         (product, version))
                except eups.ProductNotFound, e:
                    return self.findTableFile(prod.product, prod.version, prod.flavor)
                except Exception:
                    return None
Exemple #2
0
    def createDependencies(self, product, version, flavor=None, tag=None, recursive=False, exact=False,
                           mapping=server.Mapping()):
        """create a list of product dependencies based on what is known from 
        the system.

        This implementation will look up the product in the EUPS database and 
        analyze its table file.  

        @param product        the name of the product to create the package 
                                distribution for
        @param version        the name of the product version
        @param flavor         the flavor of the target platform; this may 
                                be ignored by the implentation
        @param tag            the target package collection release; this may 
                                be ignored by the implentation
        @param recursive      if False, this list will only contain the direct
                                dependencies of this product; otherwise, it 
                                will include the dependencies of the dependencies
                                recursively.  Default: False
        @param exact          Generate the complete list of dependencies that eups list -D --exact would return
        @param mapping        Mapping from desired product,version to existent product,version
        """
        deps = self._createDeps(product, version, flavor, tag, recursive, exact, mapping=mapping)
        for prod in deps.getProducts():
            prod.tablefile = None

        self.updateDependencies(deps.getProducts(), flavor=flavor, mapping=mapping)

        return deps
Exemple #3
0
    def updateDependencies(self, productList, flavor=None, mapping=server.Mapping()):
        """fill in information in the list of product dependencies based
        on what is known from the system

        A typical full implementation of this function in a sub-class would
        iterate through the products, adding the name of the table file and
        the distId.

        @param productList     list of products (output from createDependencies)
        @param flavor          the flavor of the target platform; this may 
                                 be ignored by the implentation
        @param mapping        Mapping from desired product,version to existent product,version
        """
        self.unimplemented("updateDependencies")        
Exemple #4
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