public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Mueller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:gentoo-syntax commit in: /
Date: Sat, 22 Sep 2012 17:34:44 +0000 (UTC)	[thread overview]
Message-ID: <1348334060.9175c9a69a32d23bbc4fdc921fe6ebad9e1dd333.ulm@gentoo> (raw)

commit:     9175c9a69a32d23bbc4fdc921fe6ebad9e1dd333
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 22 17:14:20 2012 +0000
Commit:     Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Sep 22 17:14:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=9175c9a6

Use the shell for parsing of eclasses' environment.

---
 ChangeLog             |    3 ++-
 keyword-generation.sh |   21 +++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01e4472..abf170d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,8 @@
 
 	* keyword-generation.sh: Drop dead or removed eclasses from
 	obsolete list. Sort it alphabetically. Skip any eclass that is
-	marked with a @DEAD token.
+	marked with a @DEAD token. Use the shell for parsing of eclasses'
+	environment.
 	(has): New function.
 	(ECLASSDIR, OBSOLETE): New variables.
 

diff --git a/keyword-generation.sh b/keyword-generation.sh
index dd7027f..6d88e17 100644
--- a/keyword-generation.sh
+++ b/keyword-generation.sh
@@ -24,21 +24,26 @@ has() {
     return 1
 }
 
-echo Output in ${TMPFILE}
-echo Manual parsing of mercurial.eclass needed! Do not forget!
+echo "Output in ${TMPFILE}"
 
 for eclass in ${ECLASSES}; do
     has ${eclass%.eclass} ${OBSOLETE} && continue
     grep -q "^# @DEAD$" "${ECLASSDIR}/${eclass}" && continue
-    echo '(defvar ebuild-mode-keywords-'${eclass//.eclass/} >>${TMPFILE}
-    echo -n \'\(\($(LC_ALL=C grep '^[A-Za-z0-9._-]*()' "${ECLASSDIR}/${eclass}"|sed -e 's:\(^.*\)().*:"\1":g')\)>>${TMPFILE}
-    echo >>${TMPFILE}
-    echo font-lock-type-face\)\)>>${TMPFILE}
-    echo >>${TMPFILE}
+
+    functions=$(env -i bash -c \
+        ". ${ECLASSDIR}/${eclass}; declare -F" 2>/dev/null \
+        | sed 's/.*[[:space:]]\(.*\)/"\1"/')
+
+    {
+        echo "(defvar ebuild-mode-keywords-${eclass%.eclass}"
+        echo "  '(("${functions}")"
+        echo "    font-lock-type-face))"
+        echo
+    } >>"${TMPFILE}"
 done
 
 emacs -q --batch \
-    --visit ${TMPFILE} \
+    --visit "${TMPFILE}" \
     --eval "(emacs-lisp-mode)" \
     --eval "(indent-region (point-min) (point-max))" \
     --eval "(let ((fill-column 78)


             reply	other threads:[~2012-09-22 17:35 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-22 17:34 Ulrich Mueller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-04 19:21 [gentoo-commits] proj/emacs-tools:gentoo-syntax commit in: / Ulrich Mueller
2013-03-09  7:42 Ulrich Mueller
2013-03-09  7:42 Ulrich Mueller
2013-03-09  7:42 Ulrich Mueller
2013-03-09  7:42 Ulrich Mueller
2013-01-13 21:15 Ulrich Mueller
2013-01-13 21:15 Ulrich Mueller
2012-09-22 22:47 Ulrich Mueller
2012-09-22 21:26 Ulrich Mueller
2012-09-22 21:26 Ulrich Mueller
2012-09-22 20:48 Ulrich Mueller
2012-09-22 17:34 Ulrich Mueller
2012-09-22 17:34 Ulrich Mueller
2012-09-22 17:34 Ulrich Mueller
2012-06-09 13:10 Ulrich Mueller
2012-05-06 18:47 Ulrich Mueller
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348334060.9175c9a69a32d23bbc4fdc921fe6ebad9e1dd333.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox