X-Git-Url: https://git.0d.be/?p=empathy.git;a=blobdiff_plain;f=release.py;h=160650ed1c3992a944ac4b274d9674d57363fef2;hp=9d20d1ab621d1d80192552e2255ddd3fc4411a78;hb=846cf36946ff8c36cf75678d9ed6552c33326228;hpb=b1d33938778faa1faa3687e87bb8646d6668992d diff --git a/release.py b/release.py index 9d20d1ab..160650ed 100755 --- a/release.py +++ b/release.py @@ -9,8 +9,7 @@ import time from string import Template from optparse import OptionParser -last_tag_patern = 'EMPATHY_2_27*' -username = 'xclaesse' +last_tag_pattern = 'EMPATHY_3_9*' upload_server = 'master.gnome.org' template = '''\ $name $version is now available for download from: @@ -68,7 +67,7 @@ class Project: version_dir = self.package_version[:second] self.package_dl_url = 'http://download.gnome.org/sources/%s/%s/' % (self.package_name.lower(), version_dir) - tags_str = self.exec_cmd('git tag -l %s' % (last_tag_patern)) + tags_str = self.exec_cmd('git tag -l %s' % (last_tag_pattern)) tags = tags_str.splitlines() self.last_tag = tags[len(tags)-1] @@ -89,12 +88,9 @@ class Project: def get_md5sums(self): md5sums = '' - cmd = 'md5sum %s-%s.tar.gz' % (self.package_name.lower(), self.package_version) + cmd = 'md5sum %s-%s.tar.xz' % (self.package_name.lower(), self.package_version) md5sums += self.exec_cmd(cmd) - cmd = 'md5sum %s-%s.tar.bz2' % (self.package_name.lower(), self.package_version) - md5sums += self.exec_cmd(cmd).strip() - return md5sums def get_bugzilla_info(self): @@ -110,10 +106,10 @@ class Project: end = s.find(s2, i + 1) description = s[start:end] - s1 = "GNOME SVN" + s1 = "homepage" i = s.find(s1) s1 = "href" - i = s.find(s1, i) + i = s.rfind(s1, 0, i) start = i + 6 s2 = '">' end = s.find(s2, start) @@ -161,6 +157,17 @@ class Project: translations += format % (lang, authors) return translations + def get_bug_author(self, bug_number): + cmd = 'git log %s.. | grep -B 20 -E \ + "(bug %s|#%s)|bugzilla.gnome.org/show_bug.cgi\?id=%s"' \ + ' | tac | grep ^Author: | head -1' \ + % (self.last_tag, bug_number, bug_number, bug_number) + line = self.exec_cmd (cmd) + p1 = line.find(" ") + p2 = line.find("<") + + return line[p1:p2].strip() + def get_bugs(self): commit_str = self.exec_cmd('git show %s' % (self.last_tag)) for line in commit_str.splitlines(): @@ -196,7 +203,11 @@ class Project: for row in reader: bug_number = row[col_bug_id] description = row[col_description] - bugs += ' - Fixed #%s, %s\n' % (bug_number, description) + author = self.get_bug_author(bug_number) + bugs += ' - Fixed #%s, %s' % (bug_number, description) + if author != '': + bugs += ' (%s)' % (author) + bugs += '\n' return bugs def generate_news(self): @@ -206,7 +217,10 @@ class Project: " - Updated %s Documentation translation (%s)\n") bugs = self.get_bugs() - news = 'NEW in '+ self.package_version + '\n==============\n' + news = 'NEW in '+ self.package_version + line = '=' * len(news) + today = datetime.date.today() + news += ' (%s)\n%s\n' % (today.strftime('%d/%m/%Y'),line) if bugs != '': news += 'Bugs fixed:\n' + bugs + '\n' if translations != '': @@ -232,8 +246,17 @@ class Project: self.package_version.replace('.', '_') self.exec_cmd('git tag -m "Tagged for release %s." %s' % ( self.package_version, new_tag)) + def _get_username(self): + username = os.environ.get('GNOME_ACCOUNT_NAME') + if username is not None: + return username + + return os.getlogin() + + def upload_tarball(self): - tarball = '%s-%s.tar.gz' % (self.package_name.lower(), self.package_version) + username = self._get_username() + tarball = '%s-%s.tar.xz' % (self.package_name.lower(), self.package_version) cmd = 'scp %s %s@%s:' % (tarball, username, upload_server) self.exec_cmd(cmd) @@ -243,6 +266,7 @@ class Project: def send_email(self): notes = self.get_release_notes() + print notes cmd = 'xdg-email ' \ ' --cc telepathy@lists.freedesktop.org' \ ' --subject "ANNOUNCE: Empathy %s"' \