From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AFE97138010 for ; Sat, 22 Sep 2012 17:34:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F11DE0495; Sat, 22 Sep 2012 17:34:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C348E0495 for ; Sat, 22 Sep 2012 17:34:45 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 717E233CEA4 for ; Sat, 22 Sep 2012 17:34:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 29AE5E5445 for ; Sat, 22 Sep 2012 17:34:44 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1348332935.a71c56294c70a7300c1744de3b9e787ee3d7334a.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:gentoo-syntax commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog keyword-generation.sh X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: a71c56294c70a7300c1744de3b9e787ee3d7334a X-VCS-Branch: gentoo-syntax Date: Sat, 22 Sep 2012 17:34:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8a2b4944-0a82-4a8b-a434-7f5a54efe587 X-Archives-Hash: 4ccbf0e104f91aaaeb3d2cdbefcae422 commit: a71c56294c70a7300c1744de3b9e787ee3d7334a Author: Ulrich Müller gentoo org> AuthorDate: Sat Sep 22 15:20:42 2012 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Sat Sep 22 16:55:35 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=a71c5629 Update keyword-generation.sh. * keyword-generation.sh: Drop dead or removed eclasses from obsolete list. Sort it alphabetically. Skip any eclass that is marked with a @DEAD token. (has): New function. (ECLASSDIR, OBSOLETE): New variables. --- ChangeLog | 8 ++++++++ keyword-generation.sh | 28 +++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c494e6b..01e4472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-09-22 Ulrich Müller + + * keyword-generation.sh: Drop dead or removed eclasses from + obsolete list. Sort it alphabetically. Skip any eclass that is + marked with a @DEAD token. + (has): New function. + (ECLASSDIR, OBSOLETE): New variables. + 2012-04-10 Ulrich Müller * gentoo-syntax.texi: Small syntax fixes. diff --git a/keyword-generation.sh b/keyword-generation.sh index 180db5c..920a7e6 100644 --- a/keyword-generation.sh +++ b/keyword-generation.sh @@ -8,23 +8,29 @@ # Generate a raw list for app-emacs/gentoo-syntax TMPFILE="$(mktemp ${TMPDIR:-/tmp}/keyword-generation.XXXXXX)" -ECLASSES=$(cd $(portageq portdir)/eclass/;ls *.eclass) - +ECLASSDIR="$(portageq portdir)/eclass" +ECLASSES=$(cd ${ECLASSDIR}; ls *.eclass) # Obsolete eclasses or ones which contain no functions -for filter in git bash-completion gems ruby qt4 php-ext-pecl-r1 \ - php-ext-source-r1 gnome.org gnustep-2 java-mvn-src kde4-meta-pkg \ - leechcraft mythtv obs-download tetex tetex-3 -do - ECLASSES=${ECLASSES//${filter}.eclass/} -done +OBSOLETE="bash-completion gems git gnome.org gnustep-2 java-mvn-src \ + kde4-meta-pkg leechcraft mythtv obs-download qt4 ruby" + +has() { + local needle=$1 item + shift + for item in "$@"; do + [[ ${item} = ${needle} ]] && return 0 + done + return 1 +} echo Output in ${TMPFILE} echo Manual parsing of mercurial.eclass needed! Do not forget! -for eclass in ${ECLASSES} -do +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._-]*()' $(portageq portdir)/eclass/${eclass}|sed -e 's:\(^.*\)().*:"\1":g')\)>>${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}