commit:     905d8108272152aab3407b8f99ce2dc7911366c9
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: Sat Sep 19 04:27:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=905d8108

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 1751396..97d3458 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -183,19 +183,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
@@ -817,3 +805,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