Exemple #1
0
    def updateTaggedRelease(self, tag, product, version, flavor="generic", info=None, distrib=None):
        """update/add the version for a given product in a tagged release
        @param tag          the name to give to this tagged release.  
        @param product      the name of the product to create
        @param version      the version of the product to create.  (Default:
                               the version marked current in the EUPS db)
        @param flavor       the flavor to associate with this release (Default:
                               "generic")
        @param info         an optional list containing extra data to associate
                               with the product in the release.
        @param distrib      a Distrib instance to use to access tag release
                              information.  If not provided, a default will be 
                              used.  
        """
        if distrib is not None and not isinstance(distrib, Distrib):
            raise TypeError("distrib parameter not a Distrib instance")
        validTags = self.getSupportedTags()
        if not self.eups.force and tag not in validTags:
            raise RuntimeError("tag %s not amoung supported tag names (%s)" % (tag, ", ".join(validTags)))

        if distrib is None:
            distrib = DefaultDistrib(
                self.eups, self.distServer, self.flavor, options=self.options, verbosity=self.verbose
            )

        pl = distrib.getTaggedRelease(self.pkgroot, tag, flavor)
        if pl is None:
            if self.verbose > 0:
                print >>self.log, "Creating new tagged release for", tag
            pl = TaggedProductList(tag, flavor)

        pl.addProduct(product, version, flavor)
        distrib.writeTaggedRelease(self.pkgroot, tag, pl, flavor, True)
Exemple #2
0
    def updateTaggedRelease(self, tag, product, version, 
                            flavor="generic", info=None, distrib=None):
        """update/add the version for a given product in a tagged release
        @param tag          the name to give to this tagged release.  
        @param product      the name of the product to create
        @param version      the version of the product to create.  (Default:
                               the version marked current in the EUPS db)
        @param flavor       the flavor to associate with this release (Default:
                               "generic")
        @param info         an optional list containing extra data to associate
                               with the product in the release.
        @param distrib      a Distrib instance to use to access tag release
                              information.  If not provided, a default will be 
                              used.  
        """
        if distrib is not None and not isinstance(distrib, Distrib):
            raise TypeError("distrib parameter not a Distrib instance")
        validTags = self.getSupportedTags()
        if not self.eups.force and tag not in validTags:
            raise RuntimeError("tag %s not amoung supported tag names (%s)" %
                               (tag, ", ".join(validTags)))

        if distrib is None:
            distrib = DefaultDistrib(self.eups, self.distServer, self.flavor, 
                                     options=self.options, 
                                     verbosity=self.verbose)

        pl = distrib.getTaggedRelease(self.pkgroot, tag, flavor)
        if pl is None:
            if self.verbose > 0:
                print >> self.log, "Creating new tagged release for", tag
            pl = TaggedProductList(tag, flavor)

        pl.addProduct(product, version, flavor)
        distrib.writeTaggedRelease(self.pkgroot, tag, pl, flavor, True);
Exemple #3
0
    def createTaggedRelease(self, top_product, top_version, flavor=None,
                            tag=None):
        """create a list of products to include in a tagged release based on 
        what is considered current (or more precisely, what is associated with
        the given tag name) in the local EUPS database and return it as a 
        TaggedProductList instance.  

        In this implementation, a list of dependencies for a top product is 
        generated; then each product dependency is recursively analyzed for 
        its dependencies.  
        @param  top_product    the product that determines via its dependencies
                                 which products are included.
        @param  top_version    the version of the top product.
        @param  flavor         the target platform for the release (default: 
                                 "generic")
        """
        release = TaggedProductList(tag, flavor, self.verbose-1, sys.log)
        self._recurseProdDeps(release, top_product, top_version, flavor)
Exemple #4
0
    def getTaggedRelease(self, serverDir, tag, flavor=None):
        """get the collection of products that make up a tagged release and 
        return it as a TaggedProductList instance.  If such a release has not
        yet been created/written, return None.
        @param serverDir      a local directory representing the root of the 
                                  package distribution tree
        @param tag            the name of the tagged release of interest
        @param flavor         the target flavor for this release.  An 
                                  implementation may ignore this variable.  
        """
        file = os.path.join(serverDir, self.getTaggedReleasePath(tag, flavor))
        if not os.path.exists(file):
            if self.verbose > 1:
                msg = "Release is not yet available: " + tag
                if flavor is not None:
                    msg += " (%s)" % flavor
                print >> self.log,  msg
            return None

        return TaggedProductList.fromFile(file, tag)
Exemple #5
0
    def getTaggedRelease(self, serverDir, tag, flavor=None):
        """get the collection of products that make up a tagged release and 
        return it as a TaggedProductList instance.  If such a release has not
        yet been created/written, return None.
        @param serverDir      a local directory representing the root of the 
                                  package distribution tree
        @param tag            the name of the tagged release of interest
        @param flavor         the target flavor for this release.  An 
                                  implementation may ignore this variable.  
        """
        file = os.path.join(serverDir, self.getTaggedReleasePath(tag, flavor))
        if not os.path.exists(file):
            if self.verbose > 1:
                msg = "Release is not yet available: " + tag
                if flavor is not None:
                    msg += " (%s)" % flavor
                print >> self.log,  msg
            return None

        return TaggedProductList.fromFile(file, tag)