Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-24 16:40:08 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-24 16:40:08 (GMT)
commit1a4c87bafe4bd1e62bfc0353f0be3486efd837c1 (patch)
treefc3dd2ffbbae4e11aa8b990d0c08a76abc350cc7 /devbot
parente8b3bdcb34e62c2cd371fe67562e753d4d4a6a16 (diff)
Properly distinguish between prefix and install dir
Diffstat (limited to 'devbot')
-rwxr-xr-xdevbot/autoinstall.py4
-rw-r--r--devbot/build.py5
-rw-r--r--devbot/config.py37
-rw-r--r--devbot/environ.py6
4 files changed, 28 insertions, 24 deletions
diff --git a/devbot/autoinstall.py b/devbot/autoinstall.py
index bb0e469..053262e 100755
--- a/devbot/autoinstall.py
+++ b/devbot/autoinstall.py
@@ -27,8 +27,8 @@ def _install(module, file):
for variable in makefile:
if variable.endswith("_PYTHON"):
dir_variable = "%sdir" % variable.replace("_PYTHON", "")
- install_dir = makefile[dir_variable]
- shutil.copy(file.get_path(), install_dir)
+ prefix_dir = makefile[dir_variable]
+ shutil.copy(file.get_path(), prefix_dir)
def _changed_cb(monitor, file, other_file, event_flags, module):
if event_flags == Gio.FileMonitorEvent.CHANGED:
diff --git a/devbot/build.py b/devbot/build.py
index d6f42fb..ca0bc07 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -83,7 +83,7 @@ def build_autotools(module):
jobs = multiprocessing.cpu_count() * 2
args = [autogen,
- "--prefix", config.install_dir,
+ "--prefix", config.prefix_dir,
"--libdir", config.lib_dir]
args.extend(module.options)
@@ -95,7 +95,7 @@ def build_autotools(module):
unlink_libtool_files()
def build_activity(module):
- command.run(["./setup.py", "install", "--prefix", config.install_dir])
+ command.run(["./setup.py", "install", "--prefix", config.prefix_dir])
def build_module(module):
module_source_dir = module.get_source_dir()
@@ -159,6 +159,7 @@ def build():
def clean():
rmtree(config.install_dir)
+ rmtree(config.prefix_dir)
rmtree(config.build_dir)
for module in config.load_modules():
diff --git a/devbot/config.py b/devbot/config.py
index 3b08b0c..a5926fe 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -8,6 +8,7 @@ config_dir = None
logs_dir = None
commands_dir = None
install_dir = None
+prefix_dir = None
source_dir = None
build_dir = None
lib_dir = None
@@ -51,58 +52,60 @@ def set_logs_dir(dir):
global logs_dir
logs_dir = dir
-def _get_real_install_dir(dir, relocatable):
+def _get_prefix_dir(dir, relocatable):
real_prefix_path = os.path.join(dir, "real_prefix")
if os.path.exists(real_prefix_path):
with open(real_prefix_path) as f:
- install_dir = f.read()
+ prefix_dir = f.read()
elif relocatable:
tmp_dir = tempfile.mkdtemp(prefix="sugar-build")
- install_dir = os.path.join(tmp_dir, "install")
+ prefix_dir = os.path.join(tmp_dir, "install")
with open(real_prefix_path, "w") as f:
- f.write(install_dir)
+ f.write(prefix_dir)
else:
return dir
- tmp_dir = os.path.dirname(install_dir)
+ tmp_dir = os.path.dirname(prefix_dir)
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)
- if os.path.islink(install_dir):
- os.remove(install_dir)
- os.symlink(dir, install_dir)
+ if os.path.islink(prefix_dir):
+ os.remove(prefix_dir)
+ os.symlink(dir, prefix_dir)
- return install_dir
+ return prefix_dir
def set_install_dir(dir, relocatable=False):
global system_lib_dir
global install_dir
+ global prefix_dir
global devbot_dir
global share_dir
global bin_dir
global etc_dir
global lib_dir
- _ensure_dir(dir)
+ install_dir = dir
+ _ensure_dir(install_dir)
- install_dir = _get_real_install_dir(dir, relocatable)
+ prefix_dir = _get_prefix_dir(dir, relocatable)
- devbot_dir = os.path.join(install_dir, "devbot")
+ devbot_dir = os.path.join(prefix_dir, "devbot")
_ensure_dir(devbot_dir)
- share_dir = os.path.join(install_dir, "share")
+ share_dir = os.path.join(prefix_dir, "share")
_ensure_dir(share_dir)
_ensure_dir(os.path.join(share_dir, "aclocal"))
- bin_dir = os.path.join(install_dir, "bin")
- etc_dir = os.path.join(install_dir, "etc")
+ bin_dir = os.path.join(prefix_dir, "bin")
+ etc_dir = os.path.join(prefix_dir, "etc")
if distro.get_use_lib64():
- lib_dir = os.path.join(install_dir, "lib64")
+ lib_dir = os.path.join(prefix_dir, "lib64")
system_lib_dir = "/usr/lib64"
else:
- lib_dir = os.path.join(install_dir, "lib")
+ lib_dir = os.path.join(prefix_dir, "lib")
system_lib_dir = "/usr/lib"
def set_source_dir(dir):
diff --git a/devbot/environ.py b/devbot/environ.py
index b1a0453..8de1a7f 100644
--- a/devbot/environ.py
+++ b/devbot/environ.py
@@ -37,9 +37,9 @@ def _setup_variables():
_add_path("GST_REGISTRY",
os.path.join(config.devbot_dir, "gstreamer.registry"))
_add_path("PYTHONPATH",
- sysconfig.get_python_lib(prefix=config.install_dir))
+ sysconfig.get_python_lib(prefix=config.prefix_dir))
_add_path("PYTHONPATH",
- sysconfig.get_python_lib(prefix=config.install_dir,
+ sysconfig.get_python_lib(prefix=config.prefix_dir,
plat_specific=True))
_add_path("XDG_DATA_DIRS", "/usr/share")
@@ -48,7 +48,7 @@ def _setup_variables():
_add_path("XDG_CONFIG_DIRS", "/etc")
_add_path("XDG_CONFIG_DIRS", config.etc_dir)
- os.environ["GTK_DATA_PREFIX"] = config.install_dir
+ os.environ["GTK_DATA_PREFIX"] = config.prefix_dir
os.environ["GTK_PATH"] = os.path.join(config.lib_dir, "gtk-2.0")
def _setup_gconf():