summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ebuild.lang113
-rwxr-xr-xportato.py2
-rw-r--r--portato/gui/gtk/windows.py7
3 files changed, 4 insertions, 118 deletions
diff --git a/ebuild.lang b/ebuild.lang
deleted file mode 100644
index d01eb3c..0000000
--- a/ebuild.lang
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- GtkSourceView syntax highlight for Gentoo-specific files
-
- Originally written for gtksourceview-1.x by:
- Leonardo Ferreira Fontenelle <leo.fontenelle@gmail.com>, 2006.
- Rewritten for gtksourceview-2 by:
- Rene 'Necoro' Neumann <necoro@necoro.net>, 2007
-
- Distributed under the same license(s) as gtksourceview.
-
- TODO:
- - do not highlight "enable" in the configure options
- - perhaps highlight portage variables and portage functions different
-
--->
-
-<language name="ebuild" id="ebuild" version="2.0" _section="Scripts">
- <metadata>
- <property name="mimetypes">text/plain</property>
- <property name="globs">*.ebuild;*.eclass</property>
- <property name="line-comment-start">#</property>
- </metadata>
-
- <styles>
- <style id="variable" _name="Portage variables" map-to="def:builtin" />
- <style id="command" _name="Portage command" map-to="def:type" />
- <style id="function" _name="Portage function" map-to="def:function" />
- </styles>
-
- <definitions>
-
- <!-- rewrite shell string to show highlighted variables -->
- <context id="string" style-ref="def:string">
- <start>"</start>
- <end>"</end>
- <include>
- <context ref="def:escape"/>
- <context ref="def:line-continue"/>
- <context ref="sh:variable1"/>
- </include>
- </context>
-
- <context id="string-2" style-ref="def:string">
- <start>'</start>
- <end>'</end>
- <include>
- <context ref="def:escape"/>
- <context ref="def:line-continue"/>
- <context ref="sh:variable1"/>
- </include>
- </context>
-
- <!-- subprograms:
- - $(..) is not supported currently in the normal sh.lang
- - `...` is interpreted as string - I think the subshell behavior is more acurate -->
- <context id="subprogram">
- <start>\$\(</start>
- <end>\)</end>
- <include>
- <context sub-pattern="0" where="start" style-ref="sh:keyword"/>
- <context sub-pattern="0" where="end" style-ref="sh:keyword"/>
- <context ref="ebuild"/>
- </include>
- </context>
-
- <context id="subprogram-2">
- <start>`</start>
- <end>`</end>
- <include>
- <context sub-pattern="0" where="start" style-ref="sh:keyword"/>
- <context sub-pattern="0" where="end" style-ref="sh:keyword"/>
- <context ref="ebuild"/>
- </include>
- </context>
-
- <!-- portage variables - currently unused -->
- <context id="portvars" style-ref="variable">
- <match>\b((ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)|(S|D|T|PV|PF|P|PN|A)|C(XX)?FLAGS|LDFLAGS|C(HOST|TARGET|BUILD))\b</match>
- </context>
-
- <!-- portage functions - currently unused -->
- <context id="portfuncs" style-ref="function">
- <match>^(src_(unpack|compile|install|test)|pkg_(config|nofetch|setup|(pre|post)(inst|rm)))</match>
- </context>
-
- <!-- extra portage commands -->
- <context id="portcmds" style-ref="command">
- <match>\b(e(begin|end|conf|install|make|warn|infon?|error|patch)|die|use(_(with|enable))?|inherit|has|(has|best)_version|unpack|(do|new)(ins|s?bin|doc|lib(|\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)|do(python|sed|dir|hard|sym|html|jar|mo)|keepdir|prepall(|docs|info|man|strip)|prep(info|lib|lib\.(so|a)|man|strip)|(|doc|ins|exe)into|f(owners|perms)|(exe|ins|dir)opts)\b</match>
- </context>
-
- <context id="built-in-command">
- <include> <!-- do not include "sh:built-in-command" as it is replaced down there - which would lead to an endless loop -->
- <context ref="sh:built-in-command-1" />
- <context ref="sh:built-in-command-2" />
- <context ref="portcmds" />
- </include>
- </context>
-
- <!-- ebuild is just a shell with the replacements -->
- <replace id="sh:string" ref="string" />
- <replace id="sh:string-2" ref="string-2" />
- <replace id="sh:built-in-command" ref="built-in-command" />
- <replace id="sh:backtick-string" ref="subprogram-2" />
- <context id="ebuild">
- <include>
- <context ref="subprogram"/>
- <context ref="sh:sh"/>
- </include>
- </context>
- </definitions>
-</language>
diff --git a/portato.py b/portato.py
index 7cca894..0c1498d 100755
--- a/portato.py
+++ b/portato.py
@@ -123,7 +123,7 @@ def main ():
env = os.environ.copy()
env.update(DBUS_SESSION_BUS_ADDRESS="")
cmd = SU_COMMAND.split()
- subprocess.Popen(cmd+["%s --no-listener --shm %ld %ld %ld %s" % (sys.argv[0], mem.key, sig.key, rw.key, " ".join(additional))], env = env, close_fds = False)
+ subprocess.Popen(cmd+["%s --no-listener --shm %ld %ld %ld %s" % (sys.argv[0], mem.key, sig.key, rw.key, " ".join(additional))], env = env)
get_listener().set_recv(mem, sig, rw)
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index b17c00c..476411d 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -25,7 +25,7 @@ from gettext import lgettext as _
# our backend stuff
from ... import get_listener, plugin
from ...helper import debug, warning, error, unique_array
-from ...constants import CONFIG_LOCATION, VERSION, APP_ICON, DATA_DIR
+from ...constants import CONFIG_LOCATION, VERSION, APP_ICON
from ...backend import flags, system
from ...backend.exceptions import PackageNotFoundException, BlockedException
@@ -383,11 +383,10 @@ class EbuildWindow (AbstractDialog):
"""Creates the buffer and the view."""
man = gtksourceview2.LanguageManager()
- man.set_search_path(man.get_search_path()+[DATA_DIR])
- language = man.get_language("ebuild")
+ language = man.get_language("gentoo")
if language is None:
- warning(_("No ebuild language file installed. Falling back to shell."))
+ warning(_("No gentoo language file installed. Falling back to shell."))
language = man.get_language("sh")
# set buffer and view