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 52887138247 for ; Wed, 22 Jan 2014 22:43:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F01FAE0B97; Wed, 22 Jan 2014 22:43:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4CB44E0B97 for ; Wed, 22 Jan 2014 22:43:37 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6261433FB7D for ; Wed, 22 Jan 2014 22:43:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 244E1187B5 for ; Wed, 22 Jan 2014 22:43:35 +0000 (UTC) From: "Ulrich Müller" 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 Müller" Message-ID: <1390429708.1d055c6902f338aacd3a312a0d2275d4ca3e5e74.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:ebuild-mode 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 Müller X-VCS-Revision: 1d055c6902f338aacd3a312a0d2275d4ca3e5e74 X-VCS-Branch: ebuild-mode Date: Wed, 22 Jan 2014 22:43:35 +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: ee9ba85f-7cfc-4fcf-b2c4-fdc78f18a295 X-Archives-Hash: 05ad2a334b50035e1d0ac81e79a4dd4b commit: 1d055c6902f338aacd3a312a0d2275d4ca3e5e74 Author: Ulrich Müller gentoo org> AuthorDate: Wed Jan 22 22:28:28 2014 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Jan 22 22:28:28 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=1d055c69 Avoid deprecated "portageq portdir" call in keyword-generation.sh. * keyword-generation.sh (ECLASSES, ECLASSFILES): Avoid deprecated "portageq portdir" call. --- ChangeLog | 5 +++++ keyword-generation.sh | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22c0f1a..98c74d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-01-22 Ulrich Müller + + * keyword-generation.sh (ECLASSES, ECLASSFILES): Avoid deprecated + "portageq portdir" call. + 2013-10-10 Ulrich Müller * ebuild-mode-keywords.el diff --git a/keyword-generation.sh b/keyword-generation.sh index bc4648b..09f028d 100755 --- a/keyword-generation.sh +++ b/keyword-generation.sh @@ -8,12 +8,16 @@ # # Generate a raw list for app-emacs/ebuild-mode +REPO=gentoo TMPFILE="$(mktemp ${TMPDIR:-/tmp}/keyword-generation.XXXXXX)" -ECLASSDIR="$(portageq portdir)/eclass" -ECLASSES=$(cd ${ECLASSDIR}; ls *.eclass | sed 's/\.eclass$//' | LC_ALL=C sort) +ECLASSES=( $(portageq available_eclasses / ${REPO} | LC_ALL=C sort) ) +ECLASSFILES=( $(portageq eclass_path / ${REPO} "${ECLASSES[@]}") ) # Obsolete eclasses OBSOLETE="bash-completion gems leechcraft ruby x-modular" +# Arrays should have equal size +[[ ${#ECLASSES[@]} -eq ${#ECLASSFILES[@]} ]] || exit 1 + has() { local needle=$1 item shift @@ -25,9 +29,10 @@ has() { echo "Output in ${TMPFILE}" -for eclass in ${ECLASSES}; do +for (( i = 0; i < ${#ECLASSES[@]}; i++ )); do + eclass=${ECLASSES[i]} has ${eclass} ${OBSOLETE} && continue - file="${ECLASSDIR}/${eclass}.eclass" + file=${ECLASSFILES[i]} grep -q "^# @DEAD$" "${file}" && continue functions=$(env -i bash -c ". ${file}; declare -F" 2>/dev/null \