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 A9A2813888F for ; Fri, 30 Oct 2015 03:57:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5D222E07DB; Fri, 30 Oct 2015 03:57:22 +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 244FCE075F for ; Fri, 30 Oct 2015 03:57:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id A2E3E340AF2 for ; Fri, 30 Oct 2015 03:57:19 +0000 (UTC) From: Mike Frysinger To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH 2/2] _argparse: punt the module Date: Thu, 29 Oct 2015 23:57:16 -0400 Message-Id: <1446177436-28621-2-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1446177436-28621-1-git-send-email-vapier@gentoo.org> References: <1446177436-28621-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: b0e9e78a-9eb4-41b6-a550-0a28ab91dcca X-Archives-Hash: 610eed22ed4e62a41416d3c57f6f238d Since we don't support python 2.6 anymore, there's no need to wrap argparse, so switch all the users to the standard library for it. --- bin/binhost-snapshot | 4 ++-- bin/ebuild | 4 ++-- bin/egencache | 4 ++-- bin/fixpackages | 4 ++-- bin/glsa-check | 4 ++-- bin/install.py | 4 ++-- bin/portageq | 6 +++--- bin/quickpkg | 4 ++-- bin/xattr-helper.py | 4 ++-- bin/xpak-helper.py | 4 ++-- pym/_emerge/main.py | 4 ++-- pym/portage/_emirrordist/main.py | 4 ++-- pym/portage/emaint/main.py | 6 ++---- pym/portage/sync/controller.py | 1 - pym/portage/tests/__init__.py | 4 ++-- pym/portage/util/_argparse.py | 42 ---------------------------------------- pym/repoman/argparser.py | 4 ++-- 17 files changed, 31 insertions(+), 76 deletions(-) delete mode 100644 pym/portage/util/_argparse.py diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot index 3a34643..4130e75 100755 --- a/bin/binhost-snapshot +++ b/bin/binhost-snapshot @@ -2,6 +2,7 @@ # Copyright 2010-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +import argparse import io import os import sys @@ -17,7 +18,6 @@ if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".porta sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True -from portage.util._argparse import ArgumentParser def parse_args(argv): prog_name = os.path.basename(argv[0]) @@ -45,7 +45,7 @@ def parse_args(argv): "write Packages index with\n" + \ " snapshot_uri" - parser = ArgumentParser(usage=usage) + parser = argparse.ArgumentParser(usage=usage) parser.add_argument('--hardlinks', help='create hardlinks (y or n, default is y)', choices=('y', 'n'), diff --git a/bin/ebuild b/bin/ebuild index ad52ed5..59fced0 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -4,6 +4,7 @@ from __future__ import print_function +import argparse import platform import signal import sys @@ -48,13 +49,12 @@ from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode from portage.const import VDB_PATH -from portage.util._argparse import ArgumentParser from _emerge.Package import Package from _emerge.RootConfig import RootConfig description = "See the ebuild(1) man page for more info" usage = "Usage: ebuild [command] ..." -parser = ArgumentParser(description=description, usage=usage) +parser = argparse.ArgumentParser(description=description, usage=usage) force_help = "When used together with the digest or manifest " + \ "command, this option forces regeneration of digests for all " + \ diff --git a/bin/egencache b/bin/egencache index 67fca73..6407a44 100755 --- a/bin/egencache +++ b/bin/egencache @@ -5,6 +5,7 @@ # unicode_literals for compat with TextIOWrapper in Python 2 from __future__ import print_function, unicode_literals +import argparse import platform import signal import stat @@ -54,7 +55,6 @@ from portage.const import TIMESTAMP_FORMAT from portage.manifest import guessManifestFileType from portage.package.ebuild._parallel_manifest.ManifestScheduler import ManifestScheduler from portage.util import cmp_sort_key, writemsg_level -from portage.util._argparse import ArgumentParser from portage.util._async.run_main_scheduler import run_main_scheduler from portage.util._eventloop.global_event_loop import global_event_loop from portage import cpv_getkey @@ -81,7 +81,7 @@ if sys.hexversion >= 0x3000000: def parse_args(args): usage = "egencache [options] ... [atom] ..." - parser = ArgumentParser(usage=usage) + parser = argparse.ArgumentParser(usage=usage) actions = parser.add_argument_group('Actions') actions.add_argument("--update", diff --git a/bin/fixpackages b/bin/fixpackages index 8a0c444..70ca9fc 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -4,6 +4,7 @@ from __future__ import print_function +import argparse import os import sys @@ -14,7 +15,6 @@ import portage portage._internal_caller = True from portage import os from portage.output import EOutput -from portage.util._argparse import ArgumentParser from textwrap import wrap from portage._global_updates import _global_updates mysettings = portage.settings @@ -25,7 +25,7 @@ description = """The fixpackages program performs package move updates on configuration files, installed packages, and binary packages.""" description = " ".join(description.split()) -parser = ArgumentParser(description=description) +parser = argparse.ArgumentParser(description=description) parser.parse_args() if mysettings['ROOT'] != "/": diff --git a/bin/glsa-check b/bin/glsa-check index 94dea73..84481d8 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -4,6 +4,7 @@ from __future__ import print_function +import argparse import sys import codecs @@ -14,7 +15,6 @@ import portage portage._internal_caller = True from portage import os from portage.output import green, red, nocolor, white -from portage.util._argparse import ArgumentParser __program__ = "glsa-check" __author__ = "Marius Mauch " @@ -24,7 +24,7 @@ __version__ = "1.0" epilog = "glsa-list can contain an arbitrary number of GLSA ids," \ " filenames containing GLSAs or the special identifiers" \ " 'all', 'new' and 'affected'" -parser = ArgumentParser(usage=__program__ + "