diff options
author | Sérgio Almeida <mephx.x@gmail.com> | 2009-08-08 18:36:41 +0100 |
---|---|---|
committer | Sérgio Almeida <mephx.x@gmail.com> | 2009-08-08 18:36:41 +0100 |
commit | 28c6f4aecc0b5f5f3c09aabe8edbeb633fad9de0 (patch) | |
tree | 90a2c61e9dfbb96a0051207063ff8e81d514fe5e | |
parent | tweaked uprofile's behaviour, minor bug fixing (diff) | |
download | uselect-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-- | .bashrc | 1 | ||||
-rw-r--r-- | uio.py | 2 | ||||
-rw-r--r-- | umodule.py | 13 | ||||
-rw-r--r-- | uselect-0.1.ebuild | 22 |
4 files changed, 32 insertions, 6 deletions
@@ -0,0 +1 @@ +PROMPT_COMMAND="PROFILE='$HOME/.uselect' ; test -e .uprofile/env.d/* && PROFILE='./.uprofile' ; source \$PROFILE/env.d/*" @@ -11,8 +11,6 @@ import stat import subprocess - - # Aligning space = ' ' right = '\t' @@ -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 +} |