Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/common.py2
-rwxr-xr-xcommands/run-tests2
-rwxr-xr-xcommands/shell7
-rw-r--r--devbot/config.py4
-rw-r--r--devbot/environ.py59
5 files changed, 36 insertions, 38 deletions
diff --git a/commands/common.py b/commands/common.py
index a5209c2..6b961bd 100644
--- a/commands/common.py
+++ b/commands/common.py
@@ -2,7 +2,6 @@ import os
import sys
base_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
-tests_dir = os.path.join(base_dir, "tests")
sys.path.append(base_dir)
@@ -19,7 +18,6 @@ def setup():
install_dir=install_dir,
source_dir=os.path.join(base_dir, "source"),
build_dir=os.path.join(base_dir, "build"),
- commands_dir=os.path.join(base_dir, "commands"),
state_dir=os.path.join(base_dir, "state"),
prefs_path=os.path.join(base_dir, "prefs"),
logs_dir=logs_dir,
diff --git a/commands/run-tests b/commands/run-tests
index 3f92681..d09f621 100755
--- a/commands/run-tests
+++ b/commands/run-tests
@@ -17,7 +17,7 @@ def _run_ui_tests():
shutil.rmtree(profile_path, ignore_errors=True)
virtual = "SUGAR_BUILDBOT" in os.environ
- test_path = os.path.join(common.tests_dir, "sugar", "shell.py")
+ test_path = os.path.join(common.base_dir, "tests", "sugar", "shell.py")
result = run.run_test("sugar-runner", test_path, virtual)
diff --git a/commands/shell b/commands/shell
index 71f3ceb..55449b8 100755
--- a/commands/shell
+++ b/commands/shell
@@ -6,6 +6,11 @@ import common
from devbot import shell
from devbot import config
+from devbot import environ
common.setup()
-shell.start(os.path.join(config.commands_dir, "bashrc"))
+
+commands_dir = os.path.join(common.base_dir, "commands")
+
+environ.add_path("PATH", commands_dir)
+shell.start(os.path.join(commands_dir, "bashrc"))
diff --git a/devbot/config.py b/devbot/config.py
index fdf4c4b..cd37e23 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -11,7 +11,6 @@ from devbot import git
config_dir = None
logs_dir = None
-commands_dir = None
install_dir = None
prefix_dir = None
lib_dir = None
@@ -85,9 +84,6 @@ def setup(**kwargs):
logs_dir = kwargs["logs_dir"]
_ensure_dir(logs_dir)
- global commands_dir
- commands_dir = kwargs["commands_dir"]
-
global _prefs_path
_prefs_path = kwargs["prefs_path"]
diff --git a/devbot/environ.py b/devbot/environ.py
index 1e3dc53..9948e47 100644
--- a/devbot/environ.py
+++ b/devbot/environ.py
@@ -7,7 +7,7 @@ def setup():
_setup_gconf()
_setup_variables()
-def _add_path(name, path):
+def add_path(name, path):
if not path.endswith("/"):
path = "%s/" % path
@@ -22,43 +22,42 @@ def _add_path(name, path):
os.environ[name] = ":".join(splitted)
def _setup_variables():
- _add_path("LD_LIBRARY_PATH", config.lib_dir)
- _add_path("PATH", config.bin_dir)
- _add_path("PATH", config.commands_dir)
-
- _add_path("ACLOCAL_PATH",
- os.path.join(config.share_dir, "aclocal"))
- _add_path("XCURSOR_PATH",
- os.path.join(config.share_dir, "icons"))
- _add_path("PKG_CONFIG_PATH",
- os.path.join(config.lib_dir, "pkgconfig"))
- _add_path("GST_PLUGIN_PATH",
- os.path.join(config.lib_dir , "gstreamer-1.0"))
- _add_path("PYTHONPATH",
- sysconfig.get_python_lib(prefix=config.prefix_dir))
- _add_path("PYTHONPATH",
- sysconfig.get_python_lib(prefix=config.prefix_dir,
- plat_specific=True))
- _add_path("PYTHONPATH",
- os.path.dirname(os.path.dirname(__file__)))
-
- _add_path("XDG_DATA_DIRS", "/usr/share")
- _add_path("XDG_DATA_DIRS", config.share_dir)
-
- _add_path("XDG_CONFIG_DIRS", "/etc")
- _add_path("XDG_CONFIG_DIRS", config.etc_dir)
+ add_path("LD_LIBRARY_PATH", config.lib_dir)
+ add_path("PATH", config.bin_dir)
+
+ add_path("ACLOCAL_PATH",
+ os.path.join(config.share_dir, "aclocal"))
+ add_path("XCURSOR_PATH",
+ os.path.join(config.share_dir, "icons"))
+ add_path("PKG_CONFIG_PATH",
+ os.path.join(config.lib_dir, "pkgconfig"))
+ add_path("GST_PLUGIN_PATH",
+ os.path.join(config.lib_dir , "gstreamer-1.0"))
+ add_path("PYTHONPATH",
+ sysconfig.get_python_lib(prefix=config.prefix_dir))
+ add_path("PYTHONPATH",
+ sysconfig.get_python_lib(prefix=config.prefix_dir,
+ plat_specific=True))
+ add_path("PYTHONPATH",
+ os.path.dirname(os.path.dirname(__file__)))
+
+ add_path("XDG_DATA_DIRS", "/usr/share")
+ add_path("XDG_DATA_DIRS", config.share_dir)
+
+ add_path("XDG_CONFIG_DIRS", "/etc")
+ add_path("XDG_CONFIG_DIRS", config.etc_dir)
for system_lib_dir in config.system_lib_dirs:
modules_path = os.path.join(system_lib_dir, "gio", "modules")
if os.path.exists(modules_path):
- _add_path("GIO_EXTRA_MODULES", modules_path)
+ add_path("GIO_EXTRA_MODULES", modules_path)
typelib_path = os.path.join(system_lib_dir, "girepository-1.0")
if os.path.exists(typelib_path):
- _add_path("GI_TYPELIB_PATH", typelib_path)
+ add_path("GI_TYPELIB_PATH", typelib_path)
- _add_path("GI_TYPELIB_PATH",
- os.path.join(config.lib_dir, "girepository-1.0"))
+ add_path("GI_TYPELIB_PATH",
+ os.path.join(config.lib_dir, "girepository-1.0"))
os.environ["GTK_DATA_PREFIX"] = config.prefix_dir
os.environ["GTK_PATH"] = os.path.join(config.lib_dir, "gtk-2.0")