diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-11 07:47:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-11 07:47:27 +0000 |
commit | 05e04a148b0f3dac7fc484334a2d89b6f9624827 (patch) | |
tree | 07d35efdec1605fac8836b31a4cbc82cb04713b1 /bin | |
parent | a7d784dcf8a160424dbd4d1a60622d384789c492 (diff) | |
download | portage-05e04a148b0f3dac7fc484334a2d89b6f9624827.tar.gz portage-05e04a148b0f3dac7fc484334a2d89b6f9624827.tar.bz2 portage-05e04a148b0f3dac7fc484334a2d89b6f9624827.zip |
Update imports to import portage.os (with unicode wrappers), and use
_unicode_encode() and _unicode_decode() where appropriate.
svn path=/main/trunk/; revision=13993
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/archive-conf | 3 | ||||
-rwxr-xr-x | bin/clean_locks | 8 | ||||
-rwxr-xr-x | bin/dispatch-conf | 3 | ||||
-rwxr-xr-x | bin/ebuild | 2 | ||||
-rwxr-xr-x | bin/egencache | 2 | ||||
-rwxr-xr-x | bin/emaint | 3 | ||||
-rwxr-xr-x | bin/env-update | 2 | ||||
-rwxr-xr-x | bin/fixpackages | 1 | ||||
-rwxr-xr-x | bin/glsa-check | 2 | ||||
-rwxr-xr-x | bin/portageq | 3 | ||||
-rwxr-xr-x | bin/quickpkg | 4 | ||||
-rwxr-xr-x | bin/regenworld | 4 | ||||
-rwxr-xr-x | bin/repoman | 2 |
13 files changed, 25 insertions, 14 deletions
diff --git a/bin/archive-conf b/bin/archive-conf index 04c6ce414..aca8d285c 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -10,7 +10,7 @@ # Jeremy Wohl's dispatch-conf script and the portage chkcontents script. # -import os, sys +import sys try: import portage except ImportError: @@ -18,6 +18,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os import dispatch_conf FIND_EXTANT_CONTENTS = "find %s -name CONTENTS" diff --git a/bin/clean_locks b/bin/clean_locks index 89473bd81..9799ad999 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -3,13 +3,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import os,sys,errno +import sys, errno try: - import portage.locks + 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.locks + import portage + +from portage import os if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv: import portage diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 0b96ee54a..68fd3e899 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -17,7 +17,7 @@ if not hasattr(__builtins__, "set"): from stat import * from random import * -import atexit, commands, os, re, shutil, stat, sys +import atexit, commands, re, shutil, stat, sys try: import portage except ImportError: @@ -25,6 +25,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os from portage import dispatch_conf from portage.process import find_binary diff --git a/bin/ebuild b/bin/ebuild index 8e1d4432f..3362dff4c 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -62,6 +62,8 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os + if not opts.ignore_default_opts: default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split() opts, pargs = parser.parse_args(default_opts + sys.argv[1:]) diff --git a/bin/egencache b/bin/egencache index f5c644be9..db0eb622d 100755 --- a/bin/egencache +++ b/bin/egencache @@ -21,7 +21,6 @@ except KeyboardInterrupt: import logging import optparse -import os try: import portage @@ -30,6 +29,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os from _emerge.MetadataRegen import MetadataRegen from portage.cache.cache_errors import CacheError, StatCollision from portage.util import writemsg_level diff --git a/bin/emaint b/bin/emaint index 0bfc88de5..6652b6ed5 100755 --- a/bin/emaint +++ b/bin/emaint @@ -1,6 +1,5 @@ #!/usr/bin/python -O # vim: noet : -import os import re import signal import sys @@ -15,7 +14,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage -import portage.const, portage.exception, portage.output +from portage import os class WorldHandler(object): diff --git a/bin/env-update b/bin/env-update index 294876808..30e25d0b2 100755 --- a/bin/env-update +++ b/bin/env-update @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import os, sys, errno +import sys, errno def usage(status): print "Usage: env-update [--no-ldconfig]" diff --git a/bin/fixpackages b/bin/fixpackages index 39b813662..a5f24a7e5 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -12,6 +12,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os mysettings = portage.settings mytrees = portage.db mtimedb = portage.mtimedb diff --git a/bin/glsa-check b/bin/glsa-check index 74a9ee7d0..ad06136e2 100755 --- a/bin/glsa-check +++ b/bin/glsa-check @@ -3,7 +3,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import os import sys try: @@ -13,6 +12,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os from portage.output import * from optparse import OptionGroup, OptionParser diff --git a/bin/portageq b/bin/portageq index e18760ce8..8cb7a2b13 100755 --- a/bin/portageq +++ b/bin/portageq @@ -41,6 +41,7 @@ except ImportError: import portage del pym_path +from portage import os from portage.util import writemsg, writemsg_stdout #----------------------------------------------------------------------------- @@ -609,7 +610,7 @@ def main(): args = sys.argv[2:] if args and not isinstance(args[0], unicode): for i in xrange(len(args)): - args[i] = unicode(args[i], encoding='utf_8', errors='replace') + args[i] = portage._unicode_decode(args[i]) try: if uses_root: diff --git a/bin/quickpkg b/bin/quickpkg index 0a1346e4e..53f7e9b27 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -3,7 +3,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import errno, signal, sys, os +import errno, signal, sys from itertools import izip try: @@ -13,6 +13,8 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage +from portage import os + def quickpkg_main(options, args, eout): from portage import catsplit, dep_expand, flatten, isvalidatom, xpak from portage.dep import use_reduce, paren_reduce diff --git a/bin/regenworld b/bin/regenworld index 11c6ea033..5d59d83f7 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -3,13 +3,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import sys, 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 portage import os import re import portage.exception diff --git a/bin/repoman b/bin/repoman index 8e0b8e428..368902255 100755 --- a/bin/repoman +++ b/bin/repoman @@ -13,7 +13,6 @@ import errno import formatter import logging import optparse -import os import re import signal import stat @@ -40,6 +39,7 @@ except ImportError: sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._disable_legacy_globals() +from portage import os try: from repoman.checks import run_checks |