commit: d695d866e4e7b2ab79264508f1520f89a5585e04 Author: Aaron Bauman <bman <AT> gentoo <DOT> org> AuthorDate: Fri Aug 7 01:12:15 2020 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Fri Aug 7 02:53:12 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d695d866
*: drop all import __future__ statements * We only support Py3 now. Signed-off-by: Aaron Bauman <bman <AT> gentoo.org> Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> bin/archive-conf | 4 +--- bin/check-implicit-pointer-usage.py | 2 -- bin/clean_locks | 4 +--- bin/dispatch-conf | 4 +--- bin/dohtml.py | 4 +--- bin/doins.py | 2 -- bin/ebuild | 4 +--- bin/egencache | 4 ++-- bin/emaint | 4 +--- bin/emerge | 4 +--- bin/env-update | 4 +--- bin/fixpackages | 4 +--- bin/glsa-check | 4 +--- bin/portageq | 4 +--- bin/quickpkg | 4 +--- bin/regenworld | 4 +--- lib/_emerge/Scheduler.py | 2 -- lib/_emerge/UserQuery.py | 2 -- lib/_emerge/actions.py | 2 -- lib/_emerge/chk_updated_cfg_files.py | 2 -- lib/_emerge/countdown.py | 4 +--- lib/_emerge/depgraph.py | 4 +--- lib/_emerge/help.py | 4 +--- lib/_emerge/main.py | 2 -- lib/_emerge/post_emerge.py | 4 +--- lib/_emerge/resolver/circular_dependency.py | 8 +++---- lib/_emerge/resolver/package_tracker.py | 4 +--- lib/_emerge/resolver/slot_collision.py | 3 +-- lib/_emerge/unmerge.py | 2 -- lib/portage/_emirrordist/FetchTask.py | 2 -- lib/portage/_global_updates.py | 4 +--- lib/portage/_sets/__init__.py | 2 -- lib/portage/_sets/dbapi.py | 2 -- lib/portage/_sets/libs.py | 4 +--- lib/portage/cache/anydbm.py | 5 ++-- lib/portage/cache/sqlite.py | 3 +-- lib/portage/cvstree.py | 2 -- lib/portage/dbapi/vartree.py | 2 -- lib/portage/dispatch_conf.py | 5 +--- lib/portage/elog/mod_echo.py | 4 +--- lib/portage/emaint/main.py | 4 +--- lib/portage/glsa.py | 27 +++++++++++----------- lib/portage/localization.py | 4 +--- lib/portage/metadata.py | 4 +--- lib/portage/module.py | 5 +--- lib/portage/news.py | 2 -- lib/portage/output.py | 2 -- lib/portage/package/ebuild/fetch.py | 2 -- lib/portage/sync/controller.py | 3 --- lib/portage/sync/old_tree_timestamp.py | 4 +--- lib/portage/tests/__init__.py | 4 +--- lib/portage/tests/util/test_xattr.py | 4 +--- .../util/_dyn_libs/display_preserved_libs.py | 6 ++--- lib/portage/util/_eventloop/EventLoop.py | 5 +--- lib/portage/util/_eventloop/PollSelectAdapter.py | 5 ++-- lib/portage/util/_xattr.py | 4 +--- lib/portage/util/locale.py | 4 ++-- lib/portage/util/movefile.py | 2 -- repoman/bin/repoman | 5 ++-- repoman/lib/repoman/actions.py | 4 +--- repoman/lib/repoman/errors.py | 2 -- repoman/lib/repoman/gpg.py | 2 -- repoman/lib/repoman/main.py | 5 ++-- repoman/lib/repoman/metadata.py | 2 -- repoman/lib/repoman/modules/commit/repochecks.py | 2 -- repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +-- repoman/lib/repoman/modules/vcs/settings.py | 3 +-- repoman/lib/repoman/modules/vcs/vcs.py | 3 +-- repoman/lib/repoman/profile.py | 2 -- repoman/lib/repoman/scanner.py | 6 ++--- repoman/lib/repoman/tests/__init__.py | 4 +--- repoman/lib/repoman/utilities.py | 4 +--- repoman/runtests | 4 +--- repoman/setup.py | 4 +--- runtests | 4 +--- setup.py | 2 -- 76 files changed, 76 insertions(+), 214 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index 8341ffe73..bfc54a629 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @@ -9,8 +9,6 @@ # Jeremy Wohl's dispatch-conf script and the portage chkcontents script. # -from __future__ import print_function - import sys from os import path as osp diff --git a/bin/check-implicit-pointer-usage.py b/bin/check-implicit-pointer-usage.py index 868e4b3c8..3914e038d 100755 --- a/bin/check-implicit-pointer-usage.py +++ b/bin/check-implicit-pointer-usage.py @@ -14,8 +14,6 @@ # crashes. # -from __future__ import print_function - import re import sys diff --git a/bin/clean_locks b/bin/clean_locks index 94ba4c606..d1f296065 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import sys, errno from os import path as osp if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 1759b89b8..fa047244a 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -b -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @@ -11,8 +11,6 @@ # dialog menus # -from __future__ import print_function - import atexit import io import re diff --git a/bin/dohtml.py b/bin/dohtml.py index 67c5eb9d1..6a1ed10fe 100755 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@ -1,5 +1,5 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @@ -28,8 +28,6 @@ # - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS # -from __future__ import print_function - import os as _os import sys diff --git a/bin/doins.py b/bin/doins.py index 5bbf92635..574340132 100644 --- a/bin/doins.py +++ b/bin/doins.py @@ -11,8 +11,6 @@ This script is designed to be executed by ebuild-helpers/doins. """ -from __future__ import print_function - import argparse import errno import grp diff --git a/bin/ebuild b/bin/ebuild index ea02fa95a..09f7f839b 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import platform import signal diff --git a/bin/egencache b/bin/egencache index e3d7cbfc3..264c600fe 100755 --- a/bin/egencache +++ b/bin/egencache @@ -1,15 +1,15 @@ #!/usr/bin/python -b -# Copyright 2009-2015 Gentoo Foundation +# Copyright 2009-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # unicode_literals for compat with TextIOWrapper in Python 2 -from __future__ import print_function import argparse import platform import signal import stat import sys + # This block ensures that ^C interrupts are handled quietly. try: diff --git a/bin/emaint b/bin/emaint index df904f7c0..5cb667f28 100755 --- a/bin/emaint +++ b/bin/emaint @@ -1,12 +1,10 @@ #!/usr/bin/python -b -# Copyright 2005-2014 Gentoo Foundation +# Copyright 2005-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """System health checks and maintenance utilities. """ -from __future__ import print_function - import sys import errno # This block ensures that ^C interrupts are handled quietly. diff --git a/bin/emerge b/bin/emerge index e372f5e9e..f0a2b8429 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 2006-2014 Gentoo Foundation +# Copyright 2006-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import platform import signal import sys diff --git a/bin/env-update b/bin/env-update index 2256b37f5..6571b0011 100755 --- a/bin/env-update +++ b/bin/env-update @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import errno import sys diff --git a/bin/fixpackages b/bin/fixpackages index a291e013d..e56d26ec1 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import os import sys diff --git a/bin/glsa-check b/bin/glsa-check index 468436353..8200f75b6 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import re import sys diff --git a/bin/portageq b/bin/portageq index 9fe5d68c1..dbcd9f62d 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import signal import sys diff --git a/bin/quickpkg b/bin/quickpkg index c4ff198b8..be7d1d7af 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division, print_function - import argparse import errno import math diff --git a/bin/regenworld b/bin/regenworld index bedc58bda..9f33502c6 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -1,9 +1,7 @@ #!/usr/bin/python -b -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import sys from os import path as osp if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py index 761ba31e0..2427d953c 100644 --- a/lib/_emerge/Scheduler.py +++ b/lib/_emerge/Scheduler.py @@ -1,8 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division, print_function - from collections import deque import gc import gzip diff --git a/lib/_emerge/UserQuery.py b/lib/_emerge/UserQuery.py index d5273e4ee..0469432fc 100644 --- a/lib/_emerge/UserQuery.py +++ b/lib/_emerge/UserQuery.py @@ -1,8 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import signal import sys diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py index 7d2d9b315..d259206ad 100644 --- a/lib/_emerge/actions.py +++ b/lib/_emerge/actions.py @@ -1,8 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division, print_function - import collections import logging import operator diff --git a/lib/_emerge/chk_updated_cfg_files.py b/lib/_emerge/chk_updated_cfg_files.py index e5e090767..f7f7ab868 100644 --- a/lib/_emerge/chk_updated_cfg_files.py +++ b/lib/_emerge/chk_updated_cfg_files.py @@ -1,8 +1,6 @@ # Copyright 1999-2012, 2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import logging import portage diff --git a/lib/_emerge/countdown.py b/lib/_emerge/countdown.py index 62e3c8dea..e9e774f9a 100644 --- a/lib/_emerge/countdown.py +++ b/lib/_emerge/countdown.py @@ -1,8 +1,6 @@ -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import sys import time diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 0810cdaf1..e071be8df 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1,9 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division, print_function - -import collections import errno import functools import io @@ -11,6 +8,7 @@ import logging import stat import textwrap import warnings +import collections from collections import deque, OrderedDict from itertools import chain diff --git a/lib/_emerge/help.py b/lib/_emerge/help.py index de3d7b593..15e1941ca 100644 --- a/lib/_emerge/help.py +++ b/lib/_emerge/help.py @@ -1,8 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - from portage.output import bold, turquoise, green def emerge_help(): diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 12323b17e..f4c7e2715 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -1,8 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import locale import platform diff --git a/lib/_emerge/post_emerge.py b/lib/_emerge/post_emerge.py index e971cf40d..0c4df0d32 100644 --- a/lib/_emerge/post_emerge.py +++ b/lib/_emerge/post_emerge.py @@ -1,8 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import logging import textwrap diff --git a/lib/_emerge/resolver/circular_dependency.py b/lib/_emerge/resolver/circular_dependency.py index 109f22b9c..7d71e6c88 100644 --- a/lib/_emerge/resolver/circular_dependency.py +++ b/lib/_emerge/resolver/circular_dependency.py @@ -1,17 +1,17 @@ # Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function +import logging + +from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange +from _emerge.Package import Package from itertools import chain, product -import logging from portage.dep import use_reduce, extract_affecting_use, check_required_use, get_required_use_flags from portage.exception import InvalidDependString from portage.output import colorize from portage.util import writemsg_level -from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange -from _emerge.Package import Package class circular_dependency_handler: diff --git a/lib/_emerge/resolver/package_tracker.py b/lib/_emerge/resolver/package_tracker.py index 2afa7923b..2cb648538 100644 --- a/lib/_emerge/resolver/package_tracker.py +++ b/lib/_emerge/resolver/package_tracker.py @@ -1,8 +1,6 @@ -# Copyright 2014 Gentoo Foundation +# Copyright 2014-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import bisect import collections diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py index df3816717..4fa07ff59 100644 --- a/lib/_emerge/resolver/slot_collision.py +++ b/lib/_emerge/resolver/slot_collision.py @@ -1,12 +1,11 @@ # Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - from _emerge.AtomArg import AtomArg from _emerge.Package import Package from _emerge.PackageArg import PackageArg from _emerge.UseFlagDisplay import pkg_use_display + from portage.dep import check_required_use from portage.output import colorize from portage._sets.base import InternalPackageSet diff --git a/lib/_emerge/unmerge.py b/lib/_emerge/unmerge.py index 548edaf0c..e8b7c9aaa 100644 --- a/lib/_emerge/unmerge.py +++ b/lib/_emerge/unmerge.py @@ -1,8 +1,6 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import logging import signal import sys diff --git a/lib/portage/_emirrordist/FetchTask.py b/lib/portage/_emirrordist/FetchTask.py index 334da7420..457ca2ac6 100644 --- a/lib/portage/_emirrordist/FetchTask.py +++ b/lib/portage/_emirrordist/FetchTask.py @@ -1,8 +1,6 @@ # Copyright 2013-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - import collections import errno import logging diff --git a/lib/portage/_global_updates.py b/lib/portage/_global_updates.py index 730ade592..855551304 100644 --- a/lib/portage/_global_updates.py +++ b/lib/portage/_global_updates.py @@ -1,8 +1,6 @@ -# Copyright 2010-2014 Gentoo Foundation +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import stat from portage import best, os diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py index ea0a8b9b4..efa6314ba 100644 --- a/lib/portage/_sets/__init__.py +++ b/lib/portage/_sets/__init__.py @@ -1,8 +1,6 @@ # Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - __all__ = ["SETPREFIX", "get_boolean", "SetConfigError", "SetConfig", "load_default_config"] diff --git a/lib/portage/_sets/dbapi.py b/lib/portage/_sets/dbapi.py index 288e4e75b..d73aedb8f 100644 --- a/lib/portage/_sets/dbapi.py +++ b/lib/portage/_sets/dbapi.py @@ -1,8 +1,6 @@ # Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - import glob import re import time diff --git a/lib/portage/_sets/libs.py b/lib/portage/_sets/libs.py index 022e076f5..90efafe79 100644 --- a/lib/portage/_sets/libs.py +++ b/lib/portage/_sets/libs.py @@ -1,8 +1,6 @@ -# Copyright 2007-2013 Gentoo Foundation +# Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - from portage.exception import InvalidData from portage.localization import _ from portage._sets.base import PackageSet diff --git a/lib/portage/cache/anydbm.py b/lib/portage/cache/anydbm.py index 4cdf264e2..70951f824 100644 --- a/lib/portage/cache/anydbm.py +++ b/lib/portage/cache/anydbm.py @@ -1,9 +1,7 @@ -# Copyright 2005-2010 Gentoo Foundation +# Copyright 2005-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Author(s): Brian Harring (ferri...@gentoo.org) -from __future__ import absolute_import - import dbm try: @@ -12,6 +10,7 @@ except ImportError: gdbm = None import pickle + from portage import _unicode_encode from portage import os from portage.cache import fs_template diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py index 3a372bcfc..55ae8f0e5 100644 --- a/lib/portage/cache/sqlite.py +++ b/lib/portage/cache/sqlite.py @@ -1,9 +1,8 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - import re + from portage.cache import fs_template from portage.cache import cache_errors from portage import os diff --git a/lib/portage/cvstree.py b/lib/portage/cvstree.py index cfcb9f48c..72e2baf84 100644 --- a/lib/portage/cvstree.py +++ b/lib/portage/cvstree.py @@ -2,8 +2,6 @@ # Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import io import re import stat diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py index fbf455363..5799d94f2 100644 --- a/lib/portage/dbapi/vartree.py +++ b/lib/portage/dbapi/vartree.py @@ -1,8 +1,6 @@ # Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - __all__ = [ "vardbapi", "vartree", "dblink"] + \ ["write_contents", "tar_contents"] diff --git a/lib/portage/dispatch_conf.py b/lib/portage/dispatch_conf.py index 71693bb36..148c9dd92 100644 --- a/lib/portage/dispatch_conf.py +++ b/lib/portage/dispatch_conf.py @@ -1,13 +1,10 @@ # archive_conf.py -- functionality common to archive-conf and dispatch-conf -# Copyright 2003-2014 Gentoo Foundation +# Copyright 2003-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 - # Library by Wayne Davison <gen...@blorf.net>, derived from code # written by Jeremy Wohl (http://igmus.org) -from __future__ import print_function - import errno import io import functools diff --git a/lib/portage/elog/mod_echo.py b/lib/portage/elog/mod_echo.py index 52e8fad8d..80f2b11ac 100644 --- a/lib/portage/elog/mod_echo.py +++ b/lib/portage/elog/mod_echo.py @@ -1,9 +1,7 @@ # elog/mod_echo.py - elog dispatch module -# Copyright 2007-2017 Gentoo Foundation +# Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import sys from portage.output import EOutput, colorize from portage.const import EBUILD_PHASES diff --git a/lib/portage/emaint/main.py b/lib/portage/emaint/main.py index c743f9bc7..a3f7a1031 100644 --- a/lib/portage/emaint/main.py +++ b/lib/portage/emaint/main.py @@ -1,8 +1,6 @@ -# Copyright 2005-2015 Gentoo Foundation +# Copyright 2005-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import sys import textwrap diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py index 27957180b..9260e7e09 100644 --- a/lib/portage/glsa.py +++ b/lib/portage/glsa.py @@ -1,28 +1,27 @@ # Copyright 2003-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import absolute_import - -import io -import sys -from urllib.request import urlopen as urllib_request_urlopen import codecs -import re import operator +import portage +import re +import sys import xml.dom.minidom -from io import StringIO + from functools import reduce -import portage +import io +from io import StringIO + +from portage import _encodings, _unicode_decode, _unicode_encode from portage import os -from portage import _encodings -from portage import _unicode_decode -from portage import _unicode_encode -from portage.versions import pkgsplit, vercmp -from portage.util import grabfile from portage.const import PRIVATE_PATH -from portage.localization import _ from portage.dep import _slot_separator +from portage.localization import _ +from portage.util import grabfile +from portage.versions import pkgsplit, vercmp + +from urllib.request import urlopen as urllib_request_urlopen # Note: the space for rgt and rlt is important !! # FIXME: use slot deps instead, requires GLSA format versioning diff --git a/lib/portage/localization.py b/lib/portage/localization.py index de54295a2..ec41caf7b 100644 --- a/lib/portage/localization.py +++ b/lib/portage/localization.py @@ -1,9 +1,7 @@ # localization.py -- Code to manage/help portage localization. -# Copyright 2004-2014 Gentoo Foundation +# Copyright 2004-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - import locale import math diff --git a/lib/portage/metadata.py b/lib/portage/metadata.py index f932c094a..a7177463f 100644 --- a/lib/portage/metadata.py +++ b/lib/portage/metadata.py @@ -1,16 +1,14 @@ # Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import logging import operator -import portage import sys import signal from _emerge.ProgressHandler import ProgressHandler +import portage from portage import eapi_is_supported from portage import os from portage.cache.cache_errors import CacheError diff --git a/lib/portage/module.py b/lib/portage/module.py index 301bfbdba..c838edb50 100644 --- a/lib/portage/module.py +++ b/lib/portage/module.py @@ -1,9 +1,6 @@ -# Copyright 2005-2015 Gentoo Foundation +# Copyright 2005-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 - -from __future__ import print_function - from portage import os from portage.exception import PortageException from portage.cache.mappings import ProtectedDict diff --git a/lib/portage/news.py b/lib/portage/news.py index 3d6b04e1e..28fcbba3a 100644 --- a/lib/portage/news.py +++ b/lib/portage/news.py @@ -2,8 +2,6 @@ # Copyright 2006-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - __all__ = ["NewsManager", "NewsItem", "DisplayRestriction", "DisplayProfileRestriction", "DisplayKeywordRestriction", "DisplayInstalledRestriction", diff --git a/lib/portage/output.py b/lib/portage/output.py index 098285a52..fb621b28c 100644 --- a/lib/portage/output.py +++ b/lib/portage/output.py @@ -1,8 +1,6 @@ # Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - __docformat__ = "epytext" import errno diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py index 65cf6e123..7c61fe463 100644 --- a/lib/portage/package/ebuild/fetch.py +++ b/lib/portage/package/ebuild/fetch.py @@ -1,8 +1,6 @@ # Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - __all__ = ['fetch'] import errno diff --git a/lib/portage/sync/controller.py b/lib/portage/sync/controller.py index 93cf7bfb4..cb68e2c37 100644 --- a/lib/portage/sync/controller.py +++ b/lib/portage/sync/controller.py @@ -1,9 +1,6 @@ # Copyright 2014-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - - import sys import logging import grp diff --git a/lib/portage/sync/old_tree_timestamp.py b/lib/portage/sync/old_tree_timestamp.py index aaed18b56..258ff38a6 100644 --- a/lib/portage/sync/old_tree_timestamp.py +++ b/lib/portage/sync/old_tree_timestamp.py @@ -1,8 +1,6 @@ -# Copyright 2010-2014 Gentoo Foundation +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - import locale import logging import time diff --git a/lib/portage/tests/__init__.py b/lib/portage/tests/__init__.py index 84341ddae..972c974f2 100644 --- a/lib/portage/tests/__init__.py +++ b/lib/portage/tests/__init__.py @@ -1,9 +1,7 @@ # tests/__init__.py -- Portage Unit Test functionality -# Copyright 2006-2013 Gentoo Foundation +# Copyright 2006-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import sys import time diff --git a/lib/portage/tests/util/test_xattr.py b/lib/portage/tests/util/test_xattr.py index 8e8c2a3d6..55b89abd5 100644 --- a/lib/portage/tests/util/test_xattr.py +++ b/lib/portage/tests/util/test_xattr.py @@ -1,10 +1,8 @@ -# Copyright 2010-2015 Gentoo Foundation +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """Tests for the portage.util._xattr module""" -from __future__ import print_function - from unittest import mock import subprocess diff --git a/lib/portage/util/_dyn_libs/display_preserved_libs.py b/lib/portage/util/_dyn_libs/display_preserved_libs.py index b16478d2b..8deafc25e 100644 --- a/lib/portage/util/_dyn_libs/display_preserved_libs.py +++ b/lib/portage/util/_dyn_libs/display_preserved_libs.py @@ -1,11 +1,9 @@ -# Copyright 2007-2013 Gentoo Foundation +# Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import logging - import portage + from portage.output import colorize def display_preserved_libs(vardb): diff --git a/lib/portage/util/_eventloop/EventLoop.py b/lib/portage/util/_eventloop/EventLoop.py index b111238a6..94e637853 100644 --- a/lib/portage/util/_eventloop/EventLoop.py +++ b/lib/portage/util/_eventloop/EventLoop.py @@ -1,8 +1,7 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division - +import asyncio as _real_asyncio import collections import errno import functools @@ -13,8 +12,6 @@ import signal import time import traceback -import asyncio as _real_asyncio - try: import fcntl except ImportError: diff --git a/lib/portage/util/_eventloop/PollSelectAdapter.py b/lib/portage/util/_eventloop/PollSelectAdapter.py index 08dc664a4..c4637a352 100644 --- a/lib/portage/util/_eventloop/PollSelectAdapter.py +++ b/lib/portage/util/_eventloop/PollSelectAdapter.py @@ -1,10 +1,9 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import division +import select from .PollConstants import PollConstants -import select class PollSelectAdapter: diff --git a/lib/portage/util/_xattr.py b/lib/portage/util/_xattr.py index 531c61efb..8225cfa30 100644 --- a/lib/portage/util/_xattr.py +++ b/lib/portage/util/_xattr.py @@ -1,4 +1,4 @@ -# Copyright 2010-2019 Gentoo Authors +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """Portability shim for xattr support @@ -11,8 +11,6 @@ See the standard xattr module for more documentation: https://pypi.python.org/pypi/pyxattr """ -from __future__ import print_function - import contextlib import os import subprocess diff --git a/lib/portage/util/locale.py b/lib/portage/util/locale.py index f7e99a4fd..99c8f7ae7 100644 --- a/lib/portage/util/locale.py +++ b/lib/portage/util/locale.py @@ -1,12 +1,12 @@ #-*- coding:utf-8 -*- -# Copyright 2015 Gentoo Foundation +# Copyright 2015-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 + """ Function to check whether the current used LC_CTYPE handles case transformations of ASCII characters in a way compatible with the POSIX locale. """ -from __future__ import absolute_import import locale import logging diff --git a/lib/portage/util/movefile.py b/lib/portage/util/movefile.py index 3a17d5240..4f8054f29 100644 --- a/lib/portage/util/movefile.py +++ b/lib/portage/util/movefile.py @@ -1,8 +1,6 @@ # Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import absolute_import - __all__ = ['movefile'] import errno diff --git a/repoman/bin/repoman b/repoman/bin/repoman index 7f6187f12..29c630772 100755 --- a/repoman/bin/repoman +++ b/repoman/bin/repoman @@ -1,14 +1,13 @@ #!/usr/bin/env python -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """Ebuild and tree health checks and maintenance utilities. """ -from __future__ import print_function - import sys import errno + # This block ensures that ^C interrupts are handled quietly. try: import signal diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py index 1afc4acb1..6f7313386 100644 --- a/repoman/lib/repoman/actions.py +++ b/repoman/lib/repoman/actions.py @@ -1,9 +1,7 @@ # -*- coding:utf-8 -*- -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import errno import io import logging diff --git a/repoman/lib/repoman/errors.py b/repoman/lib/repoman/errors.py index 3509ecc06..2ea46803b 100644 --- a/repoman/lib/repoman/errors.py +++ b/repoman/lib/repoman/errors.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import sys diff --git a/repoman/lib/repoman/gpg.py b/repoman/lib/repoman/gpg.py index 4e55a6e37..ba16ab75b 100644 --- a/repoman/lib/repoman/gpg.py +++ b/repoman/lib/repoman/gpg.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import errno import logging import subprocess diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py index 38c6a1759..28a0d8a60 100755 --- a/repoman/lib/repoman/main.py +++ b/repoman/lib/repoman/main.py @@ -1,16 +1,15 @@ #!/usr/bin/env python # -*- coding:utf-8 -*- -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import io import logging import sys # import our centrally initialized portage instance from repoman._portage import portage + portage._internal_caller = True portage._disable_legacy_globals() diff --git a/repoman/lib/repoman/metadata.py b/repoman/lib/repoman/metadata.py index 2aaedd4b0..f255a61e8 100644 --- a/repoman/lib/repoman/metadata.py +++ b/repoman/lib/repoman/metadata.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import errno import logging import sys diff --git a/repoman/lib/repoman/modules/commit/repochecks.py b/repoman/lib/repoman/modules/commit/repochecks.py index 523d414d2..1a287f978 100644 --- a/repoman/lib/repoman/modules/commit/repochecks.py +++ b/repoman/lib/repoman/modules/commit/repochecks.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - from portage.output import red from repoman.errors import err diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py index 14d6178d7..87500d205 100644 --- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py +++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import re import stat @@ -11,6 +9,7 @@ from _emerge.RootConfig import RootConfig from repoman.modules.scan.scanbase import ScanBase # import our initialized portage instance from repoman._portage import portage + from portage import os from portage.exception import InvalidPackageName diff --git a/repoman/lib/repoman/modules/vcs/settings.py b/repoman/lib/repoman/modules/vcs/settings.py index f90f05963..2770e0331 100644 --- a/repoman/lib/repoman/modules/vcs/settings.py +++ b/repoman/lib/repoman/modules/vcs/settings.py @@ -2,12 +2,11 @@ Repoman VCSSettings modules ''' -from __future__ import print_function - import logging import sys from portage.output import red + from repoman.modules.vcs import module_controller, module_names from repoman.modules.vcs.vcs import FindVCS from repoman.qa_tracker import QATracker diff --git a/repoman/lib/repoman/modules/vcs/vcs.py b/repoman/lib/repoman/modules/vcs/vcs.py index b19f486a8..fbf99d458 100644 --- a/repoman/lib/repoman/modules/vcs/vcs.py +++ b/repoman/lib/repoman/modules/vcs/vcs.py @@ -1,9 +1,8 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import collections import logging + from itertools import chain from portage import os diff --git a/repoman/lib/repoman/profile.py b/repoman/lib/repoman/profile.py index b17389c55..2337522d3 100644 --- a/repoman/lib/repoman/profile.py +++ b/repoman/lib/repoman/profile.py @@ -1,7 +1,5 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - from portage import normalize_path from portage import os from portage.output import red diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py index 8d2ce9052..f9df73d83 100644 --- a/repoman/lib/repoman/scanner.py +++ b/repoman/lib/repoman/scanner.py @@ -1,16 +1,16 @@ # -*- coding:utf-8 -*- -from __future__ import print_function - import logging +import portage + from itertools import chain -import portage from portage import normalize_path from portage import os from portage._sets.base import InternalPackageSet from portage.output import green from portage.util.futures.extendedfutures import ExtendedFuture + from repoman.metadata import get_metadata_xsd from repoman.modules.commit import repochecks from repoman.modules.commit import manifest diff --git a/repoman/lib/repoman/tests/__init__.py b/repoman/lib/repoman/tests/__init__.py index 48c52c499..85c6f0b54 100644 --- a/repoman/lib/repoman/tests/__init__.py +++ b/repoman/lib/repoman/tests/__init__.py @@ -1,9 +1,7 @@ # tests/__init__.py -- Portage Unit Test functionality -# Copyright 2006-2013 Gentoo Foundation +# Copyright 2006-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - import argparse import sys import time diff --git a/repoman/lib/repoman/utilities.py b/repoman/lib/repoman/utilities.py index 2d25fd309..c4c292227 100644 --- a/repoman/lib/repoman/utilities.py +++ b/repoman/lib/repoman/utilities.py @@ -1,13 +1,11 @@ # -*- coding:utf-8 -*- # repoman: Utilities -# Copyright 2007-2018 Gentoo Foundation +# Copyright 2007-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 """This module contains utility functions to help repoman find ebuilds to scan""" -from __future__ import print_function - __all__ = [ "editor_is_executable", "FindPackagesToScan", diff --git a/repoman/runtests b/repoman/runtests index bbda4526f..3edaaf0a8 100755 --- a/repoman/runtests +++ b/repoman/runtests @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2010-2017 Gentoo Foundation +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # Note: We don't want to import portage modules directly because we do things @@ -11,8 +11,6 @@ Note: Any additional arguments will be passed down directly to the underlying unittest runner. This lets you select specific tests to execute. """ -from __future__ import print_function - import argparse import os import shutil diff --git a/repoman/setup.py b/repoman/setup.py index f2664fae4..5fcfe12e6 100755 --- a/repoman/setup.py +++ b/repoman/setup.py @@ -1,9 +1,7 @@ #!/usr/bin/env python -# Copyright 1998-2014 Gentoo Foundation +# Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - from distutils.core import setup, Command from distutils.command.build import build from distutils.command.build_scripts import build_scripts diff --git a/runtests b/runtests index 8cbd9620f..685a7d9c7 100755 --- a/runtests +++ b/runtests @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 2010-2015 Gentoo Foundation +# Copyright 2010-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # Note: We don't want to import portage modules directly because we do things @@ -11,8 +11,6 @@ Note: Any additional arguments will be passed down directly to the underlying unittest runner. This lets you select specific tests to execute. """ -from __future__ import print_function - import argparse import os import shutil diff --git a/setup.py b/setup.py index bef5c31fa..c016db98d 100755 --- a/setup.py +++ b/setup.py @@ -2,8 +2,6 @@ # Copyright 1998-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from __future__ import print_function - from distutils.core import setup, Command, Extension from distutils.command.build import build from distutils.command.build_ext import build_ext as _build_ext