Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-23 18:29:55 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-23 18:32:14 (GMT)
commit8956a666c3fb455de4cdb167611bc478e20948da (patch)
tree0fd9973cfcbf627e6cd3e67ed3375309bf679d94
parent9c186e63e71ea79609d460a03df8327b699c7dbf (diff)
Fix shell prompt string on ubuntu
It was getting overwritten by ~/.bashrc
-rw-r--r--commands/common.py19
-rw-r--r--commands/helpers/bashrc1
-rwxr-xr-xcommands/shell4
-rw-r--r--devbot/environ.py1
-rw-r--r--devbot/shell.py7
5 files changed, 18 insertions, 14 deletions
diff --git a/commands/common.py b/commands/common.py
index 85d41ca..a8b687c 100644
--- a/commands/common.py
+++ b/commands/common.py
@@ -1,22 +1,23 @@
import os
import sys
-base_path = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+base_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+helpers_dir = os.path.join(base_dir, "commands", "helpers")
-sys.path.append(base_path)
+sys.path.append(base_dir)
from devbot import system
from devbot import config
from devbot import distro
def setup():
- config.set_config_dir(os.path.join(base_path, "config"))
- config.set_install_dir(os.path.join(base_path, "install"))
- config.set_source_dir(os.path.join(base_path, "source"))
- config.set_build_dir(os.path.join(base_path, "build"))
- config.set_commands_dir(os.path.join(base_path, "commands"))
- config.set_logs_dir(os.path.join(base_path, "logs"))
- config.set_prefs_path(os.path.join(base_path, "prefs"))
+ config.set_config_dir(os.path.join(base_dir, "config"))
+ config.set_install_dir(os.path.join(base_dir, "install"))
+ config.set_source_dir(os.path.join(base_dir, "source"))
+ config.set_build_dir(os.path.join(base_dir, "build"))
+ config.set_commands_dir(os.path.join(base_dir, "commands"))
+ config.set_logs_dir(os.path.join(base_dir, "logs"))
+ config.set_prefs_path(os.path.join(base_dir, "prefs"))
version = distro.get_system_version()
diff --git a/commands/helpers/bashrc b/commands/helpers/bashrc
new file mode 100644
index 0000000..ac5a1f9
--- /dev/null
+++ b/commands/helpers/bashrc
@@ -0,0 +1 @@
+export PS1="[sugar-build \W]$ "
diff --git a/commands/shell b/commands/shell
index e588e06..818b160 100755
--- a/commands/shell
+++ b/commands/shell
@@ -1,8 +1,10 @@
#!/usr/bin/python
+import os
+
import common
from devbot import shell
common.setup()
-shell.start()
+shell.start(os.path.join(common.helpers_dir, "bashrc"))
diff --git a/devbot/environ.py b/devbot/environ.py
index a493134..12140b7 100644
--- a/devbot/environ.py
+++ b/devbot/environ.py
@@ -51,7 +51,6 @@ def _setup_variables():
os.environ["GTK_DATA_PREFIX"] = config.install_dir
os.environ["GTK_PATH"] = os.path.join(config.lib_dir, "gtk-2.0")
- os.environ["PS1"] = "[sugar-build \W]$ "
def _setup_gconf():
gconf_dir = os.path.join(config.etc_dir, "gconf")
diff --git a/devbot/shell.py b/devbot/shell.py
index abe0695..66f26f9 100644
--- a/devbot/shell.py
+++ b/devbot/shell.py
@@ -3,9 +3,10 @@
import os
from devbot import environ
+from devbot import config
-def start():
+def start(rcfile):
environ.setup()
- user_shell = os.environ.get("SHELL", "/bin/sh")
- os.execlp(user_shell, user_shell)
+ bash_path = "/bin/bash"
+ os.execlp(bash_path, bash_path, "--rcfile", rcfile)