try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import dispatch_conf
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
def CONTENTScheck(path):
try:
import portage_locks
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage_locks
if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import dispatch_conf
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import portage_util, portage_const
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import portage_const, portage_exception
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
del os.environ["PORTAGE_LEGACY_GLOBALS"]
from portage import digraph
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
try:
portage.env_update(makelinks)
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
from stat import *
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
mysettings = portage.settings
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import portage_util
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
a=portage.pkgsplit(sys.argv[1])
else:
print portage.settings[arg]
-def get_repos(argv):
- """<root>
- Returns all repos with names (repo_name file) argv[0] = $ROOT
- """
- if len(argv) < 1:
- print "ERROR: insufficient parameters!"
- sys.exit(2)
- print " ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories())
-
-def get_repo_path(argv):
- """<root> <repo_id>+
- Returns the path to the repo named argv[1], argv[0] = $ROOT
- """
- if len(argv) < 2:
- print "ERROR: insufficient parameters!"
- sys.exit(2)
- for arg in arvg[1:]
- print portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(argv[1])
#-----------------------------------------------------------------------------
#
#
for name in globals().keys():
# Drop python stuff, modules, and our own support functions.
- if (name in ("usage", "__doc__", "__name__", "main", "os", "portage", "sys", "__builtins__", "types", "string","exithandler")):
+ if (name in ("usage", "__doc__", "__name__", "main", "os", "portage", "sys", "__builtins__", "types", "string")):
continue
# Drop non-functions
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
if uses_root:
sys.argv[2] = portage.root
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
import re
try:
import portage
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import portage
del os.environ["PORTAGE_LEGACY_GLOBALS"]
try:
import xpak
except ImportError:
- sys.path.insert(0, "/usr/lib/portage/pym")
+ from os import path as osp
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
import xpak
xpak.xpak(sys.argv[1],sys.argv[2])