From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6BA641387B1 for ; Mon, 21 Sep 2015 23:48:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 341B221C048; Mon, 21 Sep 2015 23:48:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9AC8421C048 for ; Mon, 21 Sep 2015 23:48:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4F853409AA for ; Mon, 21 Sep 2015 23:48:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7506E244 for ; Mon, 21 Sep 2015 23:47:56 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1442878966.5d91183c50d57d7ddb06721a64f2ae6f95b6aeea.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea X-VCS-Branch: repoman Date: Mon, 21 Sep 2015 23:47:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 19fdae18-d7ab-47bd-bc8a-f7ba14dd0771 X-Archives-Hash: 13bff1ea39b46e0c7b88c2a5fae96457 commit: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 02:59:11 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 21 23:42:46 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d91183c repoman/actions.py: Split out the commit footer to a function pym/repoman/actions.py | 95 ++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 1f70815..e9bf147 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -133,53 +133,8 @@ class Actions(object): sys.exit(1) commitmessage = commitmessage.rstrip() changelog_msg = commitmessage - portage_version = getattr(portage, "VERSION", None) - gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "") - dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "") - if portage_version is None: - sys.stderr.write("Failed to insert portage version in message!\n") - sys.stderr.flush() - portage_version = "Unknown" - - report_options = [] - if self.options.force: - report_options.append("--force") - if self.options.ignore_arches: - report_options.append("--ignore-arches") - if self.scanner.include_arches is not None: - report_options.append( - "--include-arches=\"%s\"" % - " ".join(sorted(self.scanner.include_arches))) - - if self.vcs_settings.vcs == "git": - # Use new footer only for git (see bug #438364). - commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version - if report_options: - commit_footer += "\nRepoMan-Options: " + " ".join(report_options) - if self.repo_settings.sign_manifests: - commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, ) - if dco_sob: - commit_footer += "\nSigned-off-by: %s" % (dco_sob, ) - else: - unameout = platform.system() + " " - if platform.system() in ["Darwin", "SunOS"]: - unameout += platform.processor() - else: - unameout += platform.machine() - commit_footer = "\n\n" - if dco_sob: - commit_footer += "Signed-off-by: %s\n" % (dco_sob, ) - commit_footer += "(Portage version: %s/%s/%s" % \ - (portage_version, self.vcs_settings.vcs, unameout) - if report_options: - commit_footer += ", RepoMan options: " + " ".join(report_options) - if self.repo_settings.sign_manifests: - commit_footer += ", signed Manifest commit with key %s" % \ - (gpg_key, ) - else: - commit_footer += ", unsigned Manifest commit" - commit_footer += ")" + commit_footer = self.get_commit_footer() commitmessage += commit_footer broken_changelog_manifests = [] @@ -797,3 +752,51 @@ class Actions(object): expansion = {} return (mynew, mychanged, myremoved, no_expansion, expansion) + + def get_commit_footer(self): + portage_version = getattr(portage, "VERSION", None) + gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "") + dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "") + report_options = [] + if self.options.force: + report_options.append("--force") + if self.options.ignore_arches: + report_options.append("--ignore-arches") + if self.scanner.include_arches is not None: + report_options.append( + "--include-arches=\"%s\"" % + " ".join(sorted(self.scanner.include_arches))) + + if portage_version is None: + sys.stderr.write("Failed to insert portage version in message!\n") + sys.stderr.flush() + portage_version = "Unknown" + # Use new footer only for git (see bug #438364). + if self.vcs_settings.vcs in ["git"]: + commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version + if report_options: + commit_footer += "\nRepoMan-Options: " + " ".join(report_options) + if self.repo_settings.sign_manifests: + commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, ) + if dco_sob: + commit_footer += "\nSigned-off-by: %s" % (dco_sob, ) + else: + unameout = platform.system() + " " + if platform.system() in ["Darwin", "SunOS"]: + unameout += platform.processor() + else: + unameout += platform.machine() + commit_footer = "\n\n" + if dco_sob: + commit_footer += "Signed-off-by: %s\n" % (dco_sob, ) + commit_footer += "(Portage version: %s/%s/%s" % \ + (portage_version, self.vcs_settings.vcs, unameout) + if report_options: + commit_footer += ", RepoMan options: " + " ".join(report_options) + if self.repo_settings.sign_manifests: + commit_footer += ", signed Manifest commit with key %s" % \ + (gpg_key, ) + else: + commit_footer += ", unsigned Manifest commit" + commit_footer += ")" + return commit_footer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 153041387B1 for ; Mon, 21 Sep 2015 23:51:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE95721C04E; Mon, 21 Sep 2015 23:51:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E4CCB21C04E for ; Mon, 21 Sep 2015 23:51:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 01BEB3409D7 for ; Mon, 21 Sep 2015 23:51:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 65C74244 for ; Mon, 21 Sep 2015 23:51:19 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1442878966.5d91183c50d57d7ddb06721a64f2ae6f95b6aeea.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/actions.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea X-VCS-Branch: master Date: Mon, 21 Sep 2015 23:51:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 25cd0afb-e002-4204-86f9-0d8cb7e16e51 X-Archives-Hash: b425d4f8c20772cab765d7fff77c1760 Message-ID: <20150921235119.tcdAyD4Alr-uYoA9PmyD5ADcgZbfCTUQoXdFU3dqQwg@z> commit: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 02:59:11 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 21 23:42:46 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d91183c repoman/actions.py: Split out the commit footer to a function pym/repoman/actions.py | 95 ++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 1f70815..e9bf147 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -133,53 +133,8 @@ class Actions(object): sys.exit(1) commitmessage = commitmessage.rstrip() changelog_msg = commitmessage - portage_version = getattr(portage, "VERSION", None) - gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "") - dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "") - if portage_version is None: - sys.stderr.write("Failed to insert portage version in message!\n") - sys.stderr.flush() - portage_version = "Unknown" - - report_options = [] - if self.options.force: - report_options.append("--force") - if self.options.ignore_arches: - report_options.append("--ignore-arches") - if self.scanner.include_arches is not None: - report_options.append( - "--include-arches=\"%s\"" % - " ".join(sorted(self.scanner.include_arches))) - - if self.vcs_settings.vcs == "git": - # Use new footer only for git (see bug #438364). - commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version - if report_options: - commit_footer += "\nRepoMan-Options: " + " ".join(report_options) - if self.repo_settings.sign_manifests: - commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, ) - if dco_sob: - commit_footer += "\nSigned-off-by: %s" % (dco_sob, ) - else: - unameout = platform.system() + " " - if platform.system() in ["Darwin", "SunOS"]: - unameout += platform.processor() - else: - unameout += platform.machine() - commit_footer = "\n\n" - if dco_sob: - commit_footer += "Signed-off-by: %s\n" % (dco_sob, ) - commit_footer += "(Portage version: %s/%s/%s" % \ - (portage_version, self.vcs_settings.vcs, unameout) - if report_options: - commit_footer += ", RepoMan options: " + " ".join(report_options) - if self.repo_settings.sign_manifests: - commit_footer += ", signed Manifest commit with key %s" % \ - (gpg_key, ) - else: - commit_footer += ", unsigned Manifest commit" - commit_footer += ")" + commit_footer = self.get_commit_footer() commitmessage += commit_footer broken_changelog_manifests = [] @@ -797,3 +752,51 @@ class Actions(object): expansion = {} return (mynew, mychanged, myremoved, no_expansion, expansion) + + def get_commit_footer(self): + portage_version = getattr(portage, "VERSION", None) + gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "") + dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "") + report_options = [] + if self.options.force: + report_options.append("--force") + if self.options.ignore_arches: + report_options.append("--ignore-arches") + if self.scanner.include_arches is not None: + report_options.append( + "--include-arches=\"%s\"" % + " ".join(sorted(self.scanner.include_arches))) + + if portage_version is None: + sys.stderr.write("Failed to insert portage version in message!\n") + sys.stderr.flush() + portage_version = "Unknown" + # Use new footer only for git (see bug #438364). + if self.vcs_settings.vcs in ["git"]: + commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version + if report_options: + commit_footer += "\nRepoMan-Options: " + " ".join(report_options) + if self.repo_settings.sign_manifests: + commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, ) + if dco_sob: + commit_footer += "\nSigned-off-by: %s" % (dco_sob, ) + else: + unameout = platform.system() + " " + if platform.system() in ["Darwin", "SunOS"]: + unameout += platform.processor() + else: + unameout += platform.machine() + commit_footer = "\n\n" + if dco_sob: + commit_footer += "Signed-off-by: %s\n" % (dco_sob, ) + commit_footer += "(Portage version: %s/%s/%s" % \ + (portage_version, self.vcs_settings.vcs, unameout) + if report_options: + commit_footer += ", RepoMan options: " + " ".join(report_options) + if self.repo_settings.sign_manifests: + commit_footer += ", signed Manifest commit with key %s" % \ + (gpg_key, ) + else: + commit_footer += ", unsigned Manifest commit" + commit_footer += ")" + return commit_footer