commit:     22fc20dea05f86d061826dc39026e10a8fec1497
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:27:19 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 02:01:42 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=22fc20de

repoamn/actions.py: Split out sign_manifest()

 pym/repoman/actions.py | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 5b55ff8..4f516da 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -186,19 +186,7 @@ class Actions(object):
                                digestgen(mysettings=self.repoman_settings, 
myportdb=self.repo_settings.portdb)
 
                if self.repo_settings.sign_manifests:
-                       try:
-                               for x in sorted(vcs_files_to_cps(
-                                       chain(myupdates, myremoved, 
mymanifests),
-                                       self.scanner.repolevel, 
self.scanner.reposplit, self.scanner.categories)):
-                                       self.repoman_settings["O"] = 
os.path.join(self.repo_settings.repodir, x)
-                                       manifest_path = 
os.path.join(self.repoman_settings["O"], "Manifest")
-                                       if not need_signature(manifest_path):
-                                               continue
-                                       gpgsign(manifest_path, 
self.repoman_settings, self.options)
-                       except portage.exception.PortageException as e:
-                               portage.writemsg("!!! %s\n" % str(e))
-                               portage.writemsg("!!! Disabled 
FEATURES='sign'\n")
-                               self.repo_settings.sign_manifests = False
+                       self.sign_manifests(myupdates, myremoved, mymanifests)
 
                if self.vcs_settings.vcs == 'git':
                        # It's not safe to use the git commit -a option since 
there might
@@ -821,3 +809,20 @@ class Actions(object):
                                        modified = True
                        if modified:
                                portage.util.write_atomic(x, b''.join(mylines), 
mode='wb')
+
+
+       def sign_manifest(self, myupdates, myremoved, mymanifests):
+               try:
+                       for x in sorted(vcs_files_to_cps(
+                               chain(myupdates, myremoved, mymanifests),
+                               self.scanner.repolevel, self.scanner.reposplit, 
self.scanner.categories)):
+                               self.repoman_settings["O"] = 
os.path.join(self.repo_settings.repodir, x)
+                               manifest_path = 
os.path.join(self.repoman_settings["O"], "Manifest")
+                               if not need_signature(manifest_path):
+                                       continue
+                               gpgsign(manifest_path, self.repoman_settings, 
self.options)
+               except portage.exception.PortageException as e:
+                       portage.writemsg("!!! %s\n" % str(e))
+                       portage.writemsg("!!! Disabled FEATURES='sign'\n")
+                       self.repo_settings.sign_manifests = False
+

Reply via email to