summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSérgio Almeida <mephx.x@gmail.com>2009-08-08 18:36:41 +0100
committerSérgio Almeida <mephx.x@gmail.com>2009-08-08 18:36:41 +0100
commit28c6f4aecc0b5f5f3c09aabe8edbeb633fad9de0 (patch)
tree90a2c61e9dfbb96a0051207063ff8e81d514fe5e
parenttweaked uprofile's behaviour, minor bug fixing (diff)
downloaduselect-28c6f4aecc0b5f5f3c09aabe8edbeb633fad9de0.tar.gz
uselect-28c6f4aecc0b5f5f3c09aabe8edbeb633fad9de0.tar.bz2
uselect-28c6f4aecc0b5f5f3c09aabe8edbeb633fad9de0.zip
started .uprofile/env.d/ .uselect/env.d/ capabilites
added sample ebuild added sample .bashrc for automatic profile switching on a per-folder basis
-rw-r--r--.bashrc1
-rw-r--r--uio.py2
-rw-r--r--umodule.py13
-rw-r--r--uselect-0.1.ebuild22
4 files changed, 32 insertions, 6 deletions
diff --git a/.bashrc b/.bashrc
new file mode 100644
index 0000000..39f88f9
--- /dev/null
+++ b/.bashrc
@@ -0,0 +1 @@
+PROMPT_COMMAND="PROFILE='$HOME/.uselect' ; test -e .uprofile/env.d/* && PROFILE='./.uprofile' ; source \$PROFILE/env.d/*"
diff --git a/uio.py b/uio.py
index 2a3bb50..30e05cd 100644
--- a/uio.py
+++ b/uio.py
@@ -11,8 +11,6 @@ import stat
import subprocess
-
-
# Aligning
space = ' '
right = '\t'
diff --git a/umodule.py b/umodule.py
index 5cc05bb..74c84f9 100644
--- a/umodule.py
+++ b/umodule.py
@@ -313,7 +313,7 @@ class Var():
"""
string = ''
for value in self.values:
- string += value + separator
+ string += value[0] + separator
return string
@@ -347,12 +347,17 @@ class ProfileAction(Action):
class Env(Action):
def do_action(self, args):
+ lines = []
for var in self.vars:
for value in var.values:
if not value[1]:
- self.usage.append(var.name)
- for value in var.values:
- self.usage.append(' ' + value[0])
+ lines.append(var.name + '=' + var.to_string())
+ self.usage.append(var.name + '=' + var.to_string())
+ break
+ file = filesystem.environment + 'env.d/' + self.name + '.sh'
+ filesystem.delete_file(file)
+ filesystem.write_file(file, lines)
+ filesystem.make_exec_file(file)
def get_var(self, name):
"""
diff --git a/uselect-0.1.ebuild b/uselect-0.1.ebuild
new file mode 100644
index 0000000..3724927
--- /dev/null
+++ b/uselect-0.1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+DESCRIPTION="Universal Select Tool"
+HOMEPAGE="http://web.ist.utl.pt/~sergio.almeida/"
+SRC_URI="http://web.ist.utl.pt/~sergio.almeida/${P}.tar.gz"
+# http://git.overlays.gentoo.org/gitweb/?p=proj/uselect.git&a=snapshot;h=master;sf=tgz
+
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_install() {
+ dodir /usr/share/uselect
+ cp -R "${S}/" "${D}/" || die "Install failed!"
+ dolink "${ROOT}"/usr/bin/uselect "${ROOT}"/usr/share/uselect
+ dolink "${ROOT}"/usr/bin/uprofile "${ROOT}"/usr/share/uprofile
+ # dodoc FAQ NEWS README || die
+}