aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bersenev <bay@hackerdom.ru>2014-02-17 17:57:05 +0600
committerAlexander Bersenev <bay@hackerdom.ru>2014-02-17 17:57:05 +0600
commit6563293d18daed502ccdb663f3c72b4bae5fe23a (patch)
treed0a7d53a7c137feb4073c963408829f88ea75c92 /portage_with_autodep/bin/binhost-snapshot
parentupdated portage to 2.2.8-r1 (diff)
downloadautodep-master.tar.gz
autodep-master.tar.bz2
autodep-master.zip
updated portage to 2.2.8-r1HEADmaster
Diffstat (limited to 'portage_with_autodep/bin/binhost-snapshot')
-rwxr-xr-xportage_with_autodep/bin/binhost-snapshot27
1 files changed, 13 insertions, 14 deletions
diff --git a/portage_with_autodep/bin/binhost-snapshot b/portage_with_autodep/bin/binhost-snapshot
index 9d2697d..376080c 100755
--- a/portage_with_autodep/bin/binhost-snapshot
+++ b/portage_with_autodep/bin/binhost-snapshot
@@ -1,9 +1,8 @@
#!/usr/bin/python
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import io
-import optparse
import os
import sys
import textwrap
@@ -13,13 +12,12 @@ 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
+portage._internal_caller = True
+from portage.util._argparse import ArgumentParser
def parse_args(argv):
prog_name = os.path.basename(argv[0])
@@ -47,11 +45,12 @@ def parse_args(argv):
"write Packages index with\n" + \
" snapshot_uri"
- parser = optparse.OptionParser(usage=usage)
- parser.add_option('--hardlinks', help='create hardlinks (y or n, default is y)',
- choices=('y', 'n'))
- parser.set_defaults(hardlinks='y')
- options, args = parser.parse_args(argv[1:])
+ parser = ArgumentParser(usage=usage)
+ parser.add_argument('--hardlinks',
+ help='create hardlinks (y or n, default is y)',
+ choices=('y', 'n'),
+ default='y')
+ options, args = parser.parse_known_args(argv[1:])
if len(args) != 4:
parser.error("Required 4 arguments, got %d" % (len(args),))