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);