1 |
commit: 1d055c6902f338aacd3a312a0d2275d4ca3e5e74 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 22 22:28:28 2014 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 22 22:28:28 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=1d055c69 |
7 |
|
8 |
Avoid deprecated "portageq portdir" call in keyword-generation.sh. |
9 |
|
10 |
* keyword-generation.sh (ECLASSES, ECLASSFILES): Avoid deprecated |
11 |
"portageq portdir" call. |
12 |
|
13 |
--- |
14 |
ChangeLog | 5 +++++ |
15 |
keyword-generation.sh | 13 +++++++++---- |
16 |
2 files changed, 14 insertions(+), 4 deletions(-) |
17 |
|
18 |
diff --git a/ChangeLog b/ChangeLog |
19 |
index 22c0f1a..98c74d7 100644 |
20 |
--- a/ChangeLog |
21 |
+++ b/ChangeLog |
22 |
@@ -1,3 +1,8 @@ |
23 |
+2014-01-22 Ulrich Müller <ulm@g.o> |
24 |
+ |
25 |
+ * keyword-generation.sh (ECLASSES, ECLASSFILES): Avoid deprecated |
26 |
+ "portageq portdir" call. |
27 |
+ |
28 |
2013-10-10 Ulrich Müller <ulm@g.o> |
29 |
|
30 |
* ebuild-mode-keywords.el |
31 |
|
32 |
diff --git a/keyword-generation.sh b/keyword-generation.sh |
33 |
index bc4648b..09f028d 100755 |
34 |
--- a/keyword-generation.sh |
35 |
+++ b/keyword-generation.sh |
36 |
@@ -8,12 +8,16 @@ |
37 |
# |
38 |
# Generate a raw list for app-emacs/ebuild-mode |
39 |
|
40 |
+REPO=gentoo |
41 |
TMPFILE="$(mktemp ${TMPDIR:-/tmp}/keyword-generation.XXXXXX)" |
42 |
-ECLASSDIR="$(portageq portdir)/eclass" |
43 |
-ECLASSES=$(cd ${ECLASSDIR}; ls *.eclass | sed 's/\.eclass$//' | LC_ALL=C sort) |
44 |
+ECLASSES=( $(portageq available_eclasses / ${REPO} | LC_ALL=C sort) ) |
45 |
+ECLASSFILES=( $(portageq eclass_path / ${REPO} "${ECLASSES[@]}") ) |
46 |
# Obsolete eclasses |
47 |
OBSOLETE="bash-completion gems leechcraft ruby x-modular" |
48 |
|
49 |
+# Arrays should have equal size |
50 |
+[[ ${#ECLASSES[@]} -eq ${#ECLASSFILES[@]} ]] || exit 1 |
51 |
+ |
52 |
has() { |
53 |
local needle=$1 item |
54 |
shift |
55 |
@@ -25,9 +29,10 @@ has() { |
56 |
|
57 |
echo "Output in ${TMPFILE}" |
58 |
|
59 |
-for eclass in ${ECLASSES}; do |
60 |
+for (( i = 0; i < ${#ECLASSES[@]}; i++ )); do |
61 |
+ eclass=${ECLASSES[i]} |
62 |
has ${eclass} ${OBSOLETE} && continue |
63 |
- file="${ECLASSDIR}/${eclass}.eclass" |
64 |
+ file=${ECLASSFILES[i]} |
65 |
grep -q "^# @DEAD$" "${file}" && continue |
66 |
|
67 |
functions=$(env -i bash -c ". ${file}; declare -F" 2>/dev/null \ |