summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2014-10-26 01:14:28 +0200
committerSebastian Pipping <sebastian@pipping.org>2014-10-26 01:15:12 +0200
commitc73f42c8ba42e34fd552f145e971f32462a96cfa (patch)
tree9d9feb06f8def7ae3fcceb2db27a55125bc6020f
parentBump version to 0.5.2 (diff)
downloadoverlint-master.tar.gz
overlint-master.tar.bz2
overlint-master.zip
Pull execution out of module scopeHEAD0.5.3master
-rw-r--r--overlint/cli.py13
1 files 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)