Esempio n. 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)
Esempio n. 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);
Esempio n. 3
0
    def createTaggedRelease(self, tag, product, version=None, flavor=None, 
                            distrib=None):
                            
        """
        create and release a named collection of products based on the 
        known dependencies of a given product.  
        @param serverRoot   the root directory of a local server distribution
                              tree
        @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 distrib      a Distrib instance to use to determine which 
                              products to include.  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 tag in validTags:
            if not self.eups.force:
                raise EupsException("Can't over-write existing tagged release "+
                                    "without --force")
            elif self.verbose > 0:
                print >> self.log, \
                    "Over-writing existing tagged release for", tag
        elif self.verbose > 0:
            print >> self.log, "Creating new tagged release for", tag

        if not flavor:  flavor = "generic"

        if not version:
            version = self.eups.findPreferredProduct(product)
            if version:
                version = version.version
        if not version:
            msg = "No local version of %s found" % product
            raise ProductNotFound(product, msg)

        if distribTypeName:
            distrib = \
                self.distFactory.createDistribByName(distribTypeName, 
                                                     options=self.options,
                                                     verbosity=self.verbose,
                                                     log=self.log)
        else:
            distrib = DefaultDistrib(self.eups, self.distServer, self.flavor, 
                                     options=self.options, 
                                     verbosity=self.verbose,
                                     log=self.log)

        release = distrib.createTaggedRelease(serverRoot, tag, product, version,
                                              flavor)
        distrib.writeTaggedRelease(self.pkgroot, tag, products, flavor, 
                                   self.eups.flavor)
Esempio n. 4
0
    def createTaggedRelease(self, tag, product, version=None, flavor=None, 
                            distrib=None):
                            
        """
        create and release a named collection of products based on the 
        known dependencies of a given product.  
        @param serverRoot   the root directory of a local server distribution
                              tree
        @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 distrib      a Distrib instance to use to determine which 
                              products to include.  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 tag in validTags:
            if not self.eups.force:
                raise EupsException("Can't over-write existing tagged release "+
                                    "without --force")
            elif self.verbose > 0:
                print >> self.log, \
                    "Over-writing existing tagged release for", tag
        elif self.verbose > 0:
            print >> self.log, "Creating new tagged release for", tag

        if not flavor:  flavor = "generic"

        if not version:
            version = self.eups.findPreferredProduct(product)
            if version:
                version = version.version
        if not version:
            msg = "No local version of %s found" % product
            raise ProductNotFound(product, msg)

        if distribTypeName:
            distrib = \
                self.distFactory.createDistribByName(distribTypeName, 
                                                     options=self.options,
                                                     verbosity=self.verbose,
                                                     log=self.log)
        else:
            distrib = DefaultDistrib(self.eups, self.distServer, self.flavor, 
                                     options=self.options, 
                                     verbosity=self.verbose,
                                     log=self.log)

        release = distrib.createTaggedRelease(serverRoot, tag, product, version,
                                              flavor)
        distrib.writeTaggedRelease(self.pkgroot, tag, products, flavor, 
                                   self.eups.flavor)