_unicode_encode() and _unicode_decode() where appropriate.
svn path=/main/trunk/; revision=13993
# Jeremy Wohl's dispatch-conf script and the portage chkcontents script.
#
-import os, sys
+import sys
try:
import portage
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"
# 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
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:
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
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:])
import logging
import optparse
-import os
try:
import portage
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
#!/usr/bin/python -O
# vim: noet :
-import os
import re
import signal
import sys
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):
# 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]"
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
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
import sys
try:
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
import portage
del pym_path
+from portage import os
from portage.util import writemsg, writemsg_stdout
#-----------------------------------------------------------------------------
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:
# 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:
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
# 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
import formatter
import logging
import optparse
-import os
import re
import signal
import stat
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
from _emerge.EbuildMerge import EbuildMerge
from _emerge.EbuildBuildDir import EbuildBuildDir
from portage.util import writemsg
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
import codecs
-import os
from portage.output import colorize
+
class Binpkg(CompositeTask):
__slots__ = ("find_blockers",
from _emerge.SpawnProcess import SpawnProcess
import urlparse
import sys
+import portage
+from portage import os
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
class BinpkgFetcher(SpawnProcess):
__slots__ = ("pkg", "pretend",
from _emerge.BinpkgFetcher import BinpkgFetcher
from _emerge.CompositeTask import CompositeTask
from _emerge.BinpkgVerifier import BinpkgVerifier
-import os
+from portage import os
+
class BinpkgPrefetcher(CompositeTask):
__slots__ = ("pkg",) + \
from _emerge.AsynchronousTask import AsynchronousTask
from portage.util import writemsg
import sys
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
import codecs
-import os
+
class BinpkgVerifier(AsynchronousTask):
__slots__ = ("logfile", "pkg",)
from portage.util import writemsg
from portage.data import secpass
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
+
try:
import cPickle as pickle
except ImportError:
import pickle
-import os
+
class BlockerCache(portage.cache.mappings.MutableMapping):
"""This caches blockers of installed packages so that dep_check does not
have to be done for every single installed package on every invocation of
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
-
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-
+import portage
+from portage import os
from portage import digraph
from portage.sets.base import InternalPackageSet
# $Id$
from _emerge.AsynchronousTask import AsynchronousTask
-import os
+from portage import os
+
class CompositeTask(AsynchronousTask):
__slots__ = ("scheduler",) + ("_current_task",)
# $Id$
from _emerge.EbuildProcess import EbuildProcess
-import os
+from portage import os
+
class EbuildBinpkg(EbuildProcess):
"""
This assumes that src_install() has successfully completed.
from _emerge.EbuildFetchonly import EbuildFetchonly
from _emerge.EbuildBuildDir import EbuildBuildDir
from portage.util import writemsg
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
import codecs
-import os
from portage.output import colorize
class EbuildBuild(CompositeTask):
# $Id$
from _emerge.SlotObject import SlotObject
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
import errno
+
class EbuildBuildDir(SlotObject):
__slots__ = ("dir_path", "pkg", "settings",
from _emerge.EbuildPhase import EbuildPhase
from _emerge.TaskSequence import TaskSequence
from _emerge.CompositeTask import CompositeTask
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
+
class EbuildExecuter(CompositeTask):
__slots__ = ("pkg", "scheduler", "settings") + ("_tree",)
from _emerge.SpawnProcess import SpawnProcess
from _emerge.EbuildBuildDir import EbuildBuildDir
import sys
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
import codecs
-import os
from portage.elog.messages import eerror
+
class EbuildFetcher(SpawnProcess):
__slots__ = ("config_pool", "fetchonly", "fetchall", "pkg", "prefetch") + \
from _emerge.SlotObject import SlotObject
import shutil
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
from portage.elog.messages import eerror
+
class EbuildFetchonly(SlotObject):
__slots__ = ("fetch_all", "pkg", "pretend", "settings")
# $Id$
from _emerge.SlotObject import SlotObject
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
+
class EbuildMerge(SlotObject):
__slots__ = ("find_blockers", "logger", "ldpath_mtimes",
from _emerge.PollConstants import PollConstants
import sys
from portage.cache.mappings import slot_dict_class
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
from itertools import izip
import fcntl
import codecs
+
class EbuildMetadataPhase(SubProcess):
"""
from _emerge.EbuildProcess import EbuildProcess
from _emerge.CompositeTask import CompositeTask
from portage.util import writemsg
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+import portage
+from portage import os
import codecs
-import os
+
class EbuildPhase(CompositeTask):
__slots__ = ("background", "pkg", "phase",
# $Id$
from _emerge.SpawnProcess import SpawnProcess
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
+
class EbuildProcess(SpawnProcess):
__slots__ = ("phase", "pkg", "settings", "tree")
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
from itertools import izip
-
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-
+import portage
+from portage import os
from _emerge.Package import Package
from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
# $Id$
import formatter
-import os
import sys
import time
except ImportError:
from StringIO import StringIO
-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
-
+import portage
+from portage import os
from portage.output import xtermTitle
from _emerge.getloadavg import getloadavg
def _write(self, s):
if sys.hexversion < 0x3000000 and isinstance(s, unicode):
# avoid potential UnicodeEncodeError
- s = s.encode('utf_8', 'replace')
+ s = portage._unicode_encode(s)
self.out.write(s)
self.out.flush()
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
-
+from portage import os
from portage.output import colorize
from _emerge.Binpkg import Binpkg
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
-
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-
+import portage
+from portage import os
from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
from _emerge.PollScheduler import PollScheduler
# $Id$
from _emerge.SpawnProcess import SpawnProcess
-try:
- import portage
-except ImportError:
- from os import path as osp
- import sys
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
-import os
+import portage
+from portage import os
+
class MiscFunctionsProcess(SpawnProcess):
"""
Spawns misc-functions.sh with an existing ebuild environment.