commit:     3ea4713d895cc1b341277c5b4db0f9d4b671b9cd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May 15 23:18:10 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May 16 04:10:26 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ea4713d

portage/sync/modules/squashdelta: Fix Attribute error, None type object bug 
549594

self.repo is only initialized as None in the __init__().
Initialize self.repo_re to None in __init__().
Correctly assign it in _configure() after the self._kwargs(kwargs) call has run.
Fix several more code bugs while testing:
initialize delta_path in sync()
_openpgp_verify() return True since it is used as a boolean by the calling 
function.
_update_mount() remove unused variable can_mount.

X-Gentoo-Bug: 549594
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549594

 pym/portage/sync/modules/squashdelta/squashdelta.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pym/portage/sync/modules/squashdelta/squashdelta.py 
b/pym/portage/sync/modules/squashdelta/squashdelta.py
index dbfdee9..6d956c6 100644
--- a/pym/portage/sync/modules/squashdelta/squashdelta.py
+++ b/pym/portage/sync/modules/squashdelta/squashdelta.py
@@ -35,9 +35,10 @@ class SquashDeltaSync(SyncBase):
        def __init__(self):
                super(SquashDeltaSync, self).__init__(
                                'squashmerge', 'dev-util/squashmerge')
-               self.repo_re = re.compile(self.repo.name + '-(.*)$')
+               self.repo_re = None
 
        def _configure(self):
+               self.repo_re = re.compile(self.repo.name + '-(.*)$')
                self.my_settings = portage.config(clone = self.settings)
                self.cache_location = DEFAULT_CACHE_LOCATION
 
@@ -60,7 +61,7 @@ class SquashDeltaSync(SyncBase):
                if 'webrsync-gpg' in self.my_settings.features:
                        # TODO: OpenPGP signature verification
                        # raise SquashDeltaError if it fails
-                       pass
+                       return True
 
        def _parse_sha512sum(self, path):
                # sha512sum.txt parsing
@@ -164,7 +165,6 @@ class SquashDeltaSync(SyncBase):
 
        def _update_mount(self, current_path):
                mount_cmd = ['mount', current_path, self.repo.location]
-               can_mount = True
                if os.path.ismount(self.repo.location):
                        # need to umount old snapshot
                        ret = portage.process.spawn(['umount', '-l', 
self.repo.location])
@@ -209,6 +209,7 @@ class SquashDeltaSync(SyncBase):
                        old_snapshot, old_version, old_path = (
                                        self._find_local_snapshot(current_path))
 
+                       delta_path = None
                        if old_version:
                                if old_version == new_version:
                                        logging.info('Snapshot up-to-date, 
verifying integrity.')

Reply via email to