From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0A7B91384C3 for ; Sat, 5 Sep 2015 21:27:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 877ED1430E; Sat, 5 Sep 2015 21:27:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 638D0142A0 for ; Sat, 5 Sep 2015 21:27:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6427C340902 for ; Sat, 5 Sep 2015 21:27:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D3A8518B for ; Sat, 5 Sep 2015 21:27:31 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1441488416.14fc1762a2c3e41c1c812af4a90a1731247bf6fd.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/, pym/repoman/checks/ebuilds/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/_portage.py pym/repoman/_subprocess.py pym/repoman/_xml.py pym/repoman/argparser.py pym/repoman/checks/ebuilds/checks.py pym/repoman/checks/ebuilds/fetches.py pym/repoman/checks/ebuilds/isebuild.py pym/repoman/checks/ebuilds/manifests.py pym/repoman/checks/ebuilds/misc.py pym/repoman/checks/ebuilds/pkgmetadata.py pym/repoman/checks/ebuilds/thirdpartymirrors.py pym/repoman/main.py pym/repoman/metadata.py pym/repoman/qa_data.py pym/repoman/repos.py pym/repoman/utilities.py pym/repoman/vcs/vcsstatus.py X-VCS-Directories: pym/repoman/vcs/ pym/repoman/checks/ebuilds/ pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 14fc1762a2c3e41c1c812af4a90a1731247bf6fd X-VCS-Branch: repoman Date: Sat, 5 Sep 2015 21:27:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e50f1b70-a84d-4b50-8a6b-9d1fb67d89fe X-Archives-Hash: 03d612a1c83c5e0816ac4914b68405b6 commit: 14fc1762a2c3e41c1c812af4a90a1731247bf6fd Author: Brian Dolbec gentoo org> AuthorDate: Tue Jun 3 05:38:19 2014 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Sep 5 21:26:56 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=14fc1762 Repoman: Create repoman/_portage.py to centrally import portage for all modules This prevents repository errors when running repoman on non repos.conf repositories. For some reason submodule imports of portage did not contain the repo being scanned. checks.py: sort the imports. argparser.py: fix a lack of a newline at the end of the file. pym/repoman/_portage.py | 26 +++++++++++++++++++++++++ pym/repoman/_subprocess.py | 4 +++- pym/repoman/_xml.py | 4 +++- pym/repoman/argparser.py | 5 ++++- pym/repoman/checks/ebuilds/checks.py | 8 ++++++-- pym/repoman/checks/ebuilds/fetches.py | 4 +++- pym/repoman/checks/ebuilds/isebuild.py | 4 +++- pym/repoman/checks/ebuilds/manifests.py | 10 ++++++---- pym/repoman/checks/ebuilds/misc.py | 3 ++- pym/repoman/checks/ebuilds/pkgmetadata.py | 4 +++- pym/repoman/checks/ebuilds/thirdpartymirrors.py | 3 ++- pym/repoman/main.py | 12 ++++++++---- pym/repoman/metadata.py | 4 +++- pym/repoman/qa_data.py | 5 ++++- pym/repoman/repos.py | 4 +++- pym/repoman/utilities.py | 4 +++- pym/repoman/vcs/vcsstatus.py | 4 +++- 17 files changed, 85 insertions(+), 23 deletions(-) diff --git a/pym/repoman/_portage.py b/pym/repoman/_portage.py new file mode 100644 index 0000000..e72ce9f --- /dev/null +++ b/pym/repoman/_portage.py @@ -0,0 +1,26 @@ + +'''repoman/_portage.py +Central location for the portage import. +There were problems when portage was imported by submodules +due to the portage instance was somehow different that the +initial portage import in main.py. The later portage imports +did not contain the repo it was working on. That repo was my cvs tree +and not listed in those subsequent portage imports. + +All modules should import portage from this one + +from repoman._portage import portage + +Then continue to import the remaining portage modules needed +''' + +import sys + +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__)))) +sys.path.insert(0, pym_path) + +import portage +portage._internal_caller = True +portage._disable_legacy_globals() + diff --git a/pym/repoman/_subprocess.py b/pym/repoman/_subprocess.py index 3a404ce..5449e64 100644 --- a/pym/repoman/_subprocess.py +++ b/pym/repoman/_subprocess.py @@ -4,7 +4,9 @@ import codecs import subprocess import sys -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from portage.process import find_binary from portage import _encodings, _unicode_encode diff --git a/pym/repoman/_xml.py b/pym/repoman/_xml.py index 513b62a..1871875 100644 --- a/pym/repoman/_xml.py +++ b/pym/repoman/_xml.py @@ -2,7 +2,9 @@ import sys import xml -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from portage.output import red from portage.process import find_binary diff --git a/pym/repoman/argparser.py b/pym/repoman/argparser.py index 45f65fd..1c9bd45 100644 --- a/pym/repoman/argparser.py +++ b/pym/repoman/argparser.py @@ -7,10 +7,13 @@ import logging import sys -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import util from portage.util._argparse import ArgumentParser + def parse_args(argv, qahelp, repoman_default_opts): """Use a customized optionParser to parse command line arguments for repoman Args: diff --git a/pym/repoman/checks/ebuilds/checks.py b/pym/repoman/checks/ebuilds/checks.py index 694d677..b3c988a 100644 --- a/pym/repoman/checks/ebuilds/checks.py +++ b/pym/repoman/checks/ebuilds/checks.py @@ -11,13 +11,17 @@ import codecs from itertools import chain import re import time -import repoman.checks.ebuilds.errors as errors -import portage + +# import our initialized portage instance +from repoman._portage import portage + from portage.eapi import ( eapi_supports_prefix, eapi_has_implicit_rdepend, eapi_has_src_prepare_and_src_configure, eapi_has_dosed_dohard, eapi_exports_AA, eapi_has_pkg_pretend) +import repoman.checks.ebuilds.errors as errors + class LineCheck(object): """Run a check on a line of an ebuild.""" diff --git a/pym/repoman/checks/ebuilds/fetches.py b/pym/repoman/checks/ebuilds/fetches.py index ccf9ff9..22e89b6 100644 --- a/pym/repoman/checks/ebuilds/fetches.py +++ b/pym/repoman/checks/ebuilds/fetches.py @@ -5,7 +5,9 @@ Performs the src_uri fetchlist and files checks from stat import S_ISDIR -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from repoman.vcs.vcs import vcs_new_changed diff --git a/pym/repoman/checks/ebuilds/isebuild.py b/pym/repoman/checks/ebuilds/isebuild.py index 2369ea6..065914e 100644 --- a/pym/repoman/checks/ebuilds/isebuild.py +++ b/pym/repoman/checks/ebuilds/isebuild.py @@ -4,7 +4,9 @@ import stat from _emerge.Package import Package from _emerge.RootConfig import RootConfig -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from repoman.qa_data import no_exec, allvars diff --git a/pym/repoman/checks/ebuilds/manifests.py b/pym/repoman/checks/ebuilds/manifests.py index fb08c5e..1d65e1d 100644 --- a/pym/repoman/checks/ebuilds/manifests.py +++ b/pym/repoman/checks/ebuilds/manifests.py @@ -2,7 +2,9 @@ import logging import sys -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from portage.package.ebuild.digestgen import digestgen from portage.util import writemsg_level @@ -11,17 +13,17 @@ from portage.util import writemsg_level class Manifests(object): - def __init__(self, options, qatracker, repoman_settings): + def __init__(self, options, qatracker=None, repoman_settings=None): self.options = options self.qatracker = qatracker self.repoman_settings = repoman_settings - - self.digest_only = options.mode != 'manifest-check' and options.digest == 'y' self.generated_manifest = False def run(self, checkdir, portdb): self.generated_manifest = False + self.digest_only = self.options.mode != 'manifest-check' \ + and self.options.digest == 'y' if self.options.pretend: return False if self.options.mode in ("manifest", 'commit', 'fix') or self.digest_only: diff --git a/pym/repoman/checks/ebuilds/misc.py b/pym/repoman/checks/ebuilds/misc.py index c1edd2c..3bf61f0 100644 --- a/pym/repoman/checks/ebuilds/misc.py +++ b/pym/repoman/checks/ebuilds/misc.py @@ -4,7 +4,8 @@ Miscelaneous ebuild check functions''' import re -import portage +# import our initialized portage instance +from repoman._portage import portage pv_toolong_re = re.compile(r'[0-9]{19,}') diff --git a/pym/repoman/checks/ebuilds/pkgmetadata.py b/pym/repoman/checks/ebuilds/pkgmetadata.py index d40691d..0778696 100644 --- a/pym/repoman/checks/ebuilds/pkgmetadata.py +++ b/pym/repoman/checks/ebuilds/pkgmetadata.py @@ -20,7 +20,9 @@ except (ImportError, SystemError, RuntimeError, Exception): out.eerror(line) sys.exit(1) -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage.exception import InvalidAtom from portage import os from portage import _encodings, _unicode_encode diff --git a/pym/repoman/checks/ebuilds/thirdpartymirrors.py b/pym/repoman/checks/ebuilds/thirdpartymirrors.py index f867c19..50a0da8 100644 --- a/pym/repoman/checks/ebuilds/thirdpartymirrors.py +++ b/pym/repoman/checks/ebuilds/thirdpartymirrors.py @@ -1,5 +1,6 @@ -import portage +# import our initialized portage instance +from repoman._portage import portage class ThirdPartyMirrors(object): diff --git a/pym/repoman/main.py b/pym/repoman/main.py index c75657e..90c0c14 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -21,7 +21,8 @@ from os import path as osp if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__)))) #, "pym") sys.path.insert(0, pym_path) -import portage +# import our centrally initialized portage instance +from repoman._portage import portage portage._internal_caller = True portage._disable_legacy_globals() @@ -118,12 +119,15 @@ if options.experimental_inherit == 'y': can_force = True portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings) +print("portdir", portdir) +print("portdir_overlay", portdir_overlay) +print("mydir", mydir) if portdir is None: sys.exit(1) myreporoot = os.path.basename(portdir_overlay) myreporoot += mydir[len(portdir_overlay):] - +print("myreporoot", myreporoot) ################## vcs_settings = VCSSettings(options, repoman_settings) @@ -286,12 +290,12 @@ for xpkg in effective_scanlist: checkdir_relative = os.path.join(catdir, checkdir_relative) checkdir_relative = os.path.join(".", checkdir_relative) -##################### +#####################^^^^^^^^^^^^^^ manifester = Manifests(options, qatracker, repoman_settings) if manifester.run(checkdir, portdb): continue if not manifester.generated_manifest: - manifester.digest_check(xpkg, checkdir) + manifester.digest_check(xpkg, checkdir) ###################### if options.mode == 'manifest-check': diff --git a/pym/repoman/metadata.py b/pym/repoman/metadata.py index 7d41e37..f2b63a7 100644 --- a/pym/repoman/metadata.py +++ b/pym/repoman/metadata.py @@ -11,7 +11,9 @@ except ImportError: from urlparse import urlparse -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import exception from portage import os from portage.output import green diff --git a/pym/repoman/qa_data.py b/pym/repoman/qa_data.py index 546e588..9081665 100644 --- a/pym/repoman/qa_data.py +++ b/pym/repoman/qa_data.py @@ -2,7 +2,10 @@ import logging from _emerge.Package import Package -import portage + +# import our initialized portage instance +from repoman._portage import portage + # 14 is the length of DESCRIPTION="" diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py index 16de8bf..b79e241 100644 --- a/pym/repoman/repos.py +++ b/pym/repoman/repos.py @@ -6,7 +6,9 @@ import re import sys import textwrap -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from portage import _encodings from portage import _unicode_encode diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index 075ab7c..93e8840 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -31,7 +31,9 @@ import textwrap import difflib from tempfile import mkstemp -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from portage import shutil from portage import _encodings diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py index f984832..6a81b1b 100644 --- a/pym/repoman/vcs/vcsstatus.py +++ b/pym/repoman/vcs/vcsstatus.py @@ -1,6 +1,8 @@ -import portage +# import our initialized portage instance +from repoman._portage import portage + from portage import os from repoman._subprocess import repoman_popen