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 894CD138010 for ; Sun, 2 Sep 2012 21:56:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 522F921C081; Sun, 2 Sep 2012 21:56:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 106FC21C081 for ; Sun, 2 Sep 2012 21:56:40 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5000D33D7F7 for ; Sun, 2 Sep 2012 21:56:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E1931E543D for ; Sun, 2 Sep 2012 21:56:38 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1346622982.50f098aee0282d5294b94c8c3c0074b3126724e6.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/archive-conf bin/binhost-snapshot bin/clean_locks bin/dispatch-conf bin/ebuild bin/egencache bin/emaint bin/emerge bin/env-update bin/fixpackages bin/glsa-check bin/portageq bin/quickpkg bin/regenworld bin/repoman X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 50f098aee0282d5294b94c8c3c0074b3126724e6 X-VCS-Branch: master Date: Sun, 2 Sep 2012 21:56:38 +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: 964fa805-c7e5-44c9-ba33-eaa7fcaaab88 X-Archives-Hash: 9daa50df653d3dd8698fb0046d1b8d6a commit: 50f098aee0282d5294b94c8c3c0074b3126724e6 Author: Zac Medico gentoo org> AuthorDate: Sun Sep 2 21:56:22 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Sep 2 21:56:22 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=50f098ae Unconditionally insert our pym dir in sys.path. This is especially necessary when running in prefix mode, since sys.path may contain the path for a different version of portage. --- bin/archive-conf | 13 ++++++------- bin/binhost-snapshot | 13 +++++-------- bin/clean_locks | 13 +++++-------- bin/dispatch-conf | 12 ++++-------- bin/ebuild | 11 ++++------- bin/egencache | 11 ++++------- bin/emaint | 11 ++++------- bin/emerge | 11 ++++------- bin/env-update | 13 ++++++------- bin/fixpackages | 13 +++++-------- bin/glsa-check | 13 +++++-------- bin/portageq | 9 ++------- bin/quickpkg | 11 ++++------- bin/regenworld | 13 +++++-------- bin/repoman | 10 ++++------ 15 files changed, 67 insertions(+), 110 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index 7978668..af34db6 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @@ -12,12 +12,11 @@ from __future__ import print_function import sys -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage + +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage import dispatch_conf diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot index 9d2697d..fe2cf6b 100755 --- a/bin/binhost-snapshot +++ b/bin/binhost-snapshot @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 2010-2011 Gentoo Foundation +# Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import io @@ -13,13 +13,10 @@ try: except ImportError: from urlparse import urlparse -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname( - osp.realpath(__file__))), "pym")) - import portage +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage def parse_args(argv): prog_name = os.path.basename(argv[0]) diff --git a/bin/clean_locks b/bin/clean_locks index 8c4299c..09ee3e5 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -1,17 +1,14 @@ #!/usr/bin/python -O -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import sys, errno -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv: diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 35979db..e5f7680 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -16,14 +16,10 @@ from __future__ import print_function from stat import ST_GID, ST_MODE, ST_UID from random import random import atexit, re, shutil, stat, sys - -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage import dispatch_conf from portage import _unicode_decode diff --git a/bin/ebuild b/bin/ebuild index 65e5bef..a21ef64 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -64,13 +64,10 @@ parser.add_option("--skip-manifest", help="skip all manifest checks", opts, pargs = parser.parse_args(args=sys.argv[1:]) -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage portage.dep._internal_warnings = True from portage import os from portage import _encodings diff --git a/bin/egencache b/bin/egencache index d0c073c..a0766b1 100755 --- a/bin/egencache +++ b/bin/egencache @@ -28,13 +28,10 @@ import time import textwrap import re -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os, _encodings, _unicode_encode, _unicode_decode from _emerge.MetadataRegen import MetadataRegen from portage.cache.cache_errors import CacheError, StatCollision diff --git a/bin/emaint b/bin/emaint index bee46c4..fd9f346 100755 --- a/bin/emaint +++ b/bin/emaint @@ -26,13 +26,10 @@ try: except KeyboardInterrupt: sys.exit(1) -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage.emaint.main import emaint_main try: diff --git a/bin/emerge b/bin/emerge index a9a5643..f618068 100755 --- a/bin/emerge +++ b/bin/emerge @@ -35,13 +35,10 @@ else: signal.signal(debug_signum, debug_signal) -try: - from _emerge.main import emerge_main -except ImportError: - from os import path as osp - import sys - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - from _emerge.main import emerge_main +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +from _emerge.main import emerge_main if __name__ == "__main__": import sys diff --git a/bin/env-update b/bin/env-update index 8a69f2b..cee3fd6 100755 --- a/bin/env-update +++ b/bin/env-update @@ -1,5 +1,5 @@ #!/usr/bin/python -O -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -25,12 +25,11 @@ if len(sys.argv) > 1: print("!!! Invalid command line options!\n") usage(1) -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage + try: portage.env_update(makelinks) except IOError as e: diff --git a/bin/fixpackages b/bin/fixpackages index dc43ed2..da08520 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -7,13 +7,10 @@ from __future__ import print_function import os import sys -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage.output import EOutput from textwrap import wrap diff --git a/bin/glsa-check b/bin/glsa-check index a840c32..eddc905 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -1,18 +1,15 @@ #!/usr/bin/python -# Copyright 2008-2011 Gentoo Foundation +# Copyright 2008-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import sys -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage.output import * diff --git a/bin/portageq b/bin/portageq index eeea277..849a866 100755 --- a/bin/portageq +++ b/bin/portageq @@ -34,13 +34,8 @@ if os.environ.get("SANDBOX_ON") == "1": ":".join(filter(None, sandbox_write)) del sandbox_write -try: - import portage -except ImportError: - sys.path.insert(0, pym_path) - import portage -del pym_path - +sys.path.insert(0, pym_path) +import portage from portage import os from portage.eapi import eapi_has_repo_deps from portage.util import writemsg, writemsg_stdout diff --git a/bin/quickpkg b/bin/quickpkg index 76259c5..a6439e2 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -11,13 +11,10 @@ import signal import sys import tarfile -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage import xpak from portage.dbapi.dep_expand import dep_expand diff --git a/bin/regenworld b/bin/regenworld index 3199fdf..a283344 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -1,17 +1,14 @@ #!/usr/bin/python -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import sys -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage - +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage from portage import os from portage._sets.files import StaticFileSet, WorldSelectedSet diff --git a/bin/repoman b/bin/repoman index dd065c8..d7c69b3 100755 --- a/bin/repoman +++ b/bin/repoman @@ -33,12 +33,10 @@ except ImportError: from itertools import chain from stat import S_ISDIR -try: - import portage -except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage +from os import path as osp +pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") +sys.path.insert(0, pym_path) +import portage portage._disable_legacy_globals() portage.dep._internal_warnings = True