示例#1
0
文件: susetagger.py 项目: awood/tito
 def __init__(self, config=None, keep_version=False, offline=False, user_config=None):
     VersionTagger.__init__(self, config=config, keep_version=keep_version,
                            offline=offline, user_config=user_config)
     self.today = strftime("%a %b %d %T %Z %Y")
     self.changes_file_name = self.spec_file_name.replace('.spec', '.changes')
     self.changes_file = os.path.join(self.full_project_dir,
             self.changes_file_name)
     self._new_changelog_msg = "Initial package release"
     self.changelog_regex = re.compile('^\s%s\s%s(\s<%s>)?' % (self.today,
         self.git_user, self.git_email.replace("+", "\+").replace(".", "\.")))
示例#2
0
 def __init__(self, config=None, keep_version=False, offline=False, user_config=None):
     VersionTagger.__init__(self, config=config)
     self.gemspec_file_name = find_file_with_extension(suffix=".gemspec")
     new_version = subprocess.check_output(
         ["ruby", "-e", "gspec = eval(File.read('" + self.gemspec_file_name + "')); " + "print(gspec.version)"]
     )
     regex = re.compile("^(\d+(?:\.\d+)*)-?(.*)$")
     match = re.match(regex, new_version)
     if match:
         debug("Deduced version='%s' release='%s'" % (match.group(1), match.group(2)))
         self._use_version = match.group(1)
         """ The release value is currently parsed, but unused. """
         self._use_release = match.group(2)
示例#3
0
文件: pulptagger.py 项目: ehelms/pulp
 def _generate_default_changelog(self, last_tag):
     """
     Generate changelog.
     Strip git log entries not matching:
       "bugzilla - <comment>"
       "- <comment>"
       "[[ comment ]]"
     @param last_tag: Last git tag.
     @type last_tag: str
     @return: The generated changelog.
     @rtype: str
     """
     entry = []
     generated = VersionTagger._generate_default_changelog(self, last_tag)
     for line in generated.split('\n'):
         match = re.match(BUGZILLA_REGEX, line)
         if match:
             entry.append(line)
             continue
         match = re.match(FEATURE_REGEX, line)
         if match:
             entry.append(match.group(2))
             continue
         match = re.search(EMBEDDED_REGEX, line)
         if match:
             entry.append(match.group(2).strip())
             continue
     return '\n'.join(entry)
示例#4
0
 def _generate_default_changelog(self, last_tag):
     """
     Generate changelog.
     Strip git log entries not matching:
       "bugzilla - <comment>"
       "- <comment>"
       "[[ comment ]]"
     @param last_tag: Last git tag.
     @type last_tag: str
     @return: The generated changelog.
     @rtype: str
     """
     entry = []
     generated = VersionTagger._generate_default_changelog(self, last_tag)
     for line in generated.split('\n'):
         match = re.match(BUGZILLA_REGEX, line)
         if match:
             entry.append(line)
             continue
         match = re.match(FEATURE_REGEX, line)
         if match:
             entry.append(match.group(2))
             continue
         match = re.search(EMBEDDED_REGEX, line)
         if match:
             entry.append(match.group(2).strip())
             continue
     if len(entry) == 0:
         entry.append(PULP_REBUILD)
     return '\n'.join(entry)
示例#5
0
 def __init__(self,
              config=None,
              keep_version=False,
              offline=False,
              user_config=None):
     VersionTagger.__init__(self, config=config)
     self.gemspec_file_name = find_file_with_extension(suffix=".gemspec")
     new_version = subprocess.check_output([
         "ruby", "-e", "gspec = eval(File.read('" + self.gemspec_file_name +
         "')); " + "print(gspec.version)"
     ])
     regex = re.compile("^(\d+(?:\.\d+)*)-?(.*)$")
     match = re.match(regex, new_version)
     if match:
         debug("Deduced version='%s' release='%s'" %
               (match.group(1), match.group(2)))
         self._use_version = match.group(1)
         """ The release value is currently parsed, but unused. """
         self._use_release = match.group(2)
示例#6
0
 def _bump_version(self):
     """
     Force options we need.
     """
     version = os.environ.get(FORCED_VERSION)
     if version:
         self._use_version = version
         forced = True
     else:
         forced = False
     return VersionTagger._bump_version(self, False, False, forced)
示例#7
0
文件: susetagger.py 项目: wottop/tito
 def __init__(self,
              config=None,
              keep_version=False,
              offline=False,
              user_config=None):
     VersionTagger.__init__(self,
                            config=config,
                            keep_version=keep_version,
                            offline=offline,
                            user_config=user_config)
     self.today = strftime("%a %b %d %T %Z %Y")
     self.changes_file_name = self.spec_file_name.replace(
         '.spec', '.changes')
     self.changes_file = os.path.join(self.full_project_dir,
                                      self.changes_file_name)
     self._new_changelog_msg = "Initial package release"
     self.changelog_regex = re.compile(
         '^\s%s\s%s(\s<%s>)?' %
         (self.today, self.git_user, self.git_email.replace(
             "+", "\+").replace(".", "\.")))
示例#8
0
 def _bump_version(self):
     """
     Bump the version unless VERSION_AND_RELEASE specified
     in the environment.  When specified, both the version and
     release are forced as specified.
     VERSION_AND_RELEASE must be VR part of NEVRA
       Eg: 2.0.1-0.1.alpha
     """
     version = os.environ.get(VERSION_AND_RELEASE)
     if version:
         parts = version.rsplit('-', 1)
         if len(parts) != 2:
             error_out('"%s" not valid' % version)
         self.__update_spec(*parts)
         return version
     else:
         return VersionTagger._bump_version(self)
示例#9
0
 def _bump_version(self):
     """
     Bump the version unless VERSION_AND_RELEASE specified
     in the environment.  When specified, both the version and
     release are forced as specified.
     VERSION_AND_RELEASE must be VR part of NEVRA
       Eg: 2.0.1-0.1.alpha
     """
     version = os.environ.get(VERSION_AND_RELEASE)
     if version:
         parts = version.rsplit('-', 1)
         if len(parts) != 2:
             error_out('"%s" not valid' % version)
         self.__update_spec(*parts)
         return version
     else:
         return VersionTagger._bump_version(self)
示例#10
0
文件: pulptagger.py 项目: ehelms/pulp
 def _bump_version(self):
     """
     Force options we need.
     """
     return VersionTagger._bump_version(self, False, False, True)
示例#11
0
 def test_today_datetime(self):
     self.config["buildconfig"] = {"changelog_date_with_time": True}
     tagger = VersionTagger(self.config)
     assert tagger.today == "Wed Apr 22 15:02:00 UTC 2020"
示例#12
0
 def test_today(self):
     tagger = VersionTagger(self.config)
     assert tagger.today == "Wed Apr 22 2020"