Ejemplo n.º 1
0
    def released_versions(self):
        """Generate the list of Komodo releases (latest first).
        
        A Komodo "release" counts if there is a ver dir in
        the Komodo builds share with a GoldBits directory.

        Returns 3-tuples:
            (<parsed-version-tuple>, <version-string>, <is-beta>)
        E.g.:
            ((4,2,0,'b',1,12345),    "4.2.0b1",        True)
            ((6,0,0,'c',0,12346),    "6.0.0c1",        True)
            ((4,1,1,'f',0,12346),    "4.1.1",          False)
        """
        if self._released_versions_cache is None:
            self._released_versions_cache = []
            for f in buildutils.remote_glob(
                        rjoin(self.pkg_base_dir, "*", "GoldBits")):
                ver_str = basename(dirname(f))
                try:
                    ver = buildutils.split_short_ver(ver_str, intify=True)
                except ValueError, ex:
                    log.warn("invalid GoldBits dir `%s': %s", f, ex)
                    continue
                if len(ver) == 3: # e.g. (4,1,0) -> (4,1,0,'c',0)
                    # This helps sort 4.1.0 before 4.1.0b2.
                    ver = (ver[0], ver[1], ver[2], 'f', 0)
                    is_beta = False
                else:
                    is_beta = True
                
                pkg_pat = rjoin(self.pkg_base_dir, ver_str, "GoldBits",
                                "%s-*-*.msi" % self.pkg_prefix)
                for p in buildutils.remote_glob(pkg_pat):
                    # Warning: This parse is brittle.
                    changenum = int(splitext(basename(p))[0].split('-')[-1])
                    break
                else:
                    #log.warn("skip version '%s' (can't determine changenum)",
                    #         ver_str)
                    continue
                ver = tuple(list(ver) + [changenum])

                self._released_versions_cache.append(
                    (ver, ver_str, is_beta)
                )
            self._released_versions_cache.sort(reverse=True)
Ejemplo n.º 2
0
    def released_versions(self):
        """Generate the list of Komodo releases (latest first).
        
        A Komodo "release" counts if there is a ver dir in
        the Komodo builds share with a GoldBits directory.

        Returns 3-tuples:
            (<parsed-version-tuple>, <version-string>, <is-beta>)
        E.g.:
            ((4,2,0,'b',1,12345),    "4.2.0b1",        True)
            ((6,0,0,'c',0,12346),    "6.0.0c1",        True)
            ((4,1,1,'f',0,12346),    "4.1.1",          False)
        """
        if self._released_versions_cache is None:
            self._released_versions_cache = []
            for f in buildutils.remote_glob(
                    rjoin(self.pkg_base_dir, "*", "GoldBits")):
                ver_str = basename(dirname(f))
                try:
                    ver = buildutils.split_short_ver(ver_str, intify=True)
                except ValueError, ex:
                    log.warn("invalid GoldBits dir `%s': %s", f, ex)
                    continue
                if len(ver) == 3:  # e.g. (4,1,0) -> (4,1,0,'c',0)
                    # This helps sort 4.1.0 before 4.1.0b2.
                    ver = (ver[0], ver[1], ver[2], 'f', 0)
                    is_beta = False
                else:
                    is_beta = True

                pkg_pat = rjoin(self.pkg_base_dir, ver_str, "GoldBits",
                                "%s-*-*.msi" % self.pkg_prefix)
                for p in buildutils.remote_glob(pkg_pat):
                    # Warning: This parse is brittle.
                    changenum = int(splitext(basename(p))[0].split('-')[-1])
                    break
                else:
                    #log.warn("skip version '%s' (can't determine changenum)",
                    #         ver_str)
                    continue
                ver = tuple(list(ver) + [changenum])

                self._released_versions_cache.append((ver, ver_str, is_beta))
            self._released_versions_cache.sort(reverse=True)
Ejemplo n.º 3
0
 def determine(self, config_var_from_name, options):
     version = config_var_from_name["version"].value
     self.value = buildutils.split_short_ver(version,
                                             intify=True,
                                             pad_zeros=3)
Ejemplo n.º 4
0
 def determine(self, config_var_from_name, options):
     version = config_var_from_name["version"].value
     self.value = buildutils.split_short_ver(version, intify=True, pad_zeros=3)