commit:     c73f42c8ba42e34fd552f145e971f32462a96cfa
Author:     Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Sat Oct 25 23:14:28 2014 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sat Oct 25 23:15:12 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/overlint.git;a=commit;h=c73f42c8

Pull execution out of module scope

---
 overlint/cli.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/overlint/cli.py b/overlint/cli.py
index 2161757..46e3d32 100644
--- a/overlint/cli.py
+++ b/overlint/cli.py
@@ -3,7 +3,7 @@
 
 from __future__ import print_function
 
-VERSION_STR = '0.5.2'
+VERSION_STR = '0.5.3'
 
 import sys
 import os
@@ -21,7 +21,10 @@ except ImportError:
 _revision_matcher = re.compile('-r([0-9]+)$')
 _ignore_matcher = re.compile('(?:^# (?:\\$Header|Copyright)|KEYWORDS=)')
 
-portdir = portage.settings["PORTDIR"]
+
+def get_portdir():
+       return portage.settings["PORTDIR"]
+
 
 def find_atoms(repository_path, category_package):
        versions = list()
@@ -113,7 +116,7 @@ def find_ebuild_changes(category_package, overlay_path, 
gentoo_versions, overlay
        category, package = category_package.split('/')
        for version in intersection:
                ebuild_name = '%s-%s.ebuild' % (package, version)
-               filename_a = os.path.join(portdir, category_package, 
ebuild_name)
+               filename_a = os.path.join(get_portdir(), category_package, 
ebuild_name)
                filename_b = os.path.join(overlay_path, category_package, 
ebuild_name)
                if ebuilds_are_equivalent(filename_a, filename_b):
                        continue
@@ -180,13 +183,13 @@ def main(args):
                        category_package = 
full_path_overlay[len(conf.overlay_path + '/'):]
                        if len(category_package.split('/')) != 2:
                                continue
-                       full_path_gentoo = os.path.join(portdir, 
category_package)
+                       full_path_gentoo = os.path.join(get_portdir(), 
category_package)
                        found = os.path.exists(full_path_gentoo)
                        if not found:
                                continue
 
                        overlay_versions = find_atoms(conf.overlay_path, 
category_package)
-                       gentoo_versions = find_atoms(portdir, category_package)
+                       gentoo_versions = find_atoms(get_portdir(), 
category_package)
                        (missed_revision_bumps, missed_version_bumps) = 
find_missed_bumps(gentoo_versions, overlay_versions)
                        lagging_behind_gentoo = 
find_lagging_behind_gentoo(gentoo_versions, overlay_versions)
                        ebuild_changes = find_ebuild_changes(category_package, 
conf.overlay_path, gentoo_versions, overlay_versions)

Reply via email to