order and detection of circular dependencies.
* The world and system sets allow automatic update of all installed slots.
* DEPEND atoms support SLOT dependencies of the form ${CATEGORY}/${PN}:${SLOT}.
-* Development: Extend PORTAGE_PYM_PATH support to allow overriding the hardcoded
+* Development: Extend PYTHONPATH support to allow overriding the hardcoded
/usr/lib/portage/pym for development/testing purposes
portage-2.1.1
#
import os, sys, string
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
-import portage, dispatch_conf
+import dispatch_conf
FIND_EXTANT_CONTENTS = "find %s -name CONTENTS"
# the right files).
import string, os.path, os, sys
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
def CONTENTScheck(path):
try:
# $Id$
import os,sys,errno
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-
-import portage_locks
+try:
+ import portage_locks
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage_locks
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, string, sys
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
-import portage, dispatch_conf
+import dispatch_conf
from portage_exec import find_binary
FIND_EXTANT_CONFIGS = "find '%s' %s -iname '._cfg????_%s'"
os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
os.environ["PORTAGE_CALLER"]="ebuild"
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
-import portage, portage_util, portage_const
+import portage_util, portage_const
# do this _after_ 'import portage' to prevent unnecessary tracing
if debug and "python-trace" in portage.features:
#!/usr/bin/python -O
import sys, os
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
from optparse import OptionParser, OptionValueError
import re
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
-import os, portage, portage_const, portage_exception
+import portage_const, portage_exception
class WorldHandler(object):
def name():
sys.exit(1)
import os, stat
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
os.environ["PORTAGE_LEGACY_GLOBALS"] = "false"
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
del os.environ["PORTAGE_LEGACY_GLOBALS"]
from portage import digraph
# $Id$
import os,sys
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
def usage(status):
print "Usage: env-update [--no-ldconfig]"
print "!!! Invalid command line options!\n"
usage(1)
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
portage.env_update(makelinks)
# $Id$
import os,sys,re
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
from stat import *
from output import *
import os,sys
os.environ["PORTAGE_CALLER"]="fixpackages"
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
mysettings = portage.settings
mytrees = portage.db
import os,sys,string
os.environ["FEATURES"]="mirror cvs"
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
from threading import *
from output import red,green,blue,bold
from random import shuffle
# $Id$
import sys, os
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
a=portage.pkgsplit(sys.argv[1])
if a:
sys.exit(1)
import os
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
import types,string
if uses_root:
os.environ["ROOT"] = sys.argv[2]
global portage
- import portage
+ try:
+ import portage
+ except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
if uses_root:
sys.argv[2] = portage.root
function(sys.argv[2:])
# $Id$
import sys, os
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
-import portage, string, re
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
+import string, re
__candidatematcher__ = re.compile("^[0-9]+: \\*\\*\\* emerge ")
__noncandidatematcher__ = re.compile(" sync( |$)| clean( |$)| search( |$)|--oneshot|--fetchonly| unmerge( |$)")
if not hasattr(__builtins__, "set"):
from sets import Set as set
exename=os.path.basename(sys.argv[0])
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
version="1.2"
allowed_filename_chars="a-zA-Z0-9._-+:"
import string,signal,re,pickle,tempfile
os.environ["PORTAGE_LEGACY_GLOBALS"] = "false"
-import portage
+try:
+ import portage
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import portage
del os.environ["PORTAGE_LEGACY_GLOBALS"]
import portage_checksum
print "xpak: expecting three arguments."
sys.exit(1)
-sys.path.insert(0, os.environ.get("PORTAGE_PYM_PATH", "/usr/lib/portage/pym"))
+try:
+ import xpak
+except ImportError:
+ sys.path.insert(0, "/usr/lib/portage/pym")
+ import xpak
-import xpak
xpak.xpak(sys.argv[1],sys.argv[2])