Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1e2a38

Browse files
committed
Enhance make_ctags and make_etags.
make_ctags did not include field members of structs since the commit964d01a.For example, in the following field of RestrictInfo: Selectivity norm_selec pg_node_attr(equal_ignore);pg_node_attr was mistakenly interpreted to be the name of the field.To fix this, add -I option to ctags command if the command isExuberant ctags or Universal ctags (for plain old ctags, structmembers are not included in the tags file anyway).Also add "-e" and "-n" options to make_ctags. The -e option invokesctags command with -e option, which produces TAGS file for emacs. Thisallows to eliminate duplicate codes in make_etags so that make_etagsjust exec make_ctags with -e option.The -n option allows not to produce symbolic links in eachsub directory (the default is producing symbolic links).Author: Yugo NagataReviewers: Alvaro Herrera, Tatsuo IshiiDiscussion:https://postgr.es/m/flat/20221007154442.76233afc7c5b255c4de6528a%40sraoss.co.jp
1 parentc68ec1b commitd1e2a38

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

‎src/tools/make_ctags

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
11
#!/bin/sh
22

3-
# src/tools/make_ctags
3+
# src/tools/make_ctags [-e] [-n]
4+
# If -e is specified, generate tags files for emacs.
5+
# If -n is specified, don't create symbolic links of tags file.
6+
usage="Usage:$0 [-e][-n]"
7+
if [$#-gt 2 ]
8+
thenecho$usage
9+
exit 1
10+
fi
11+
12+
MODE=
13+
NO_SYMLINK=
14+
TAGS_FILE="tags"
15+
16+
while [$#-gt 0 ]
17+
do
18+
if [$1="-e" ]
19+
thenMODE="-e"
20+
TAGS_FILE="TAGS"
21+
elif [$1="-n" ]
22+
thenNO_SYMLINK="Y"
23+
else
24+
echo$usage
25+
exit 1
26+
fi
27+
shift
28+
done
429

530
command -v ctags>/dev/null|| \
631
{echo"'ctags' program not found"1>&2;exit 1; }
732

833
trap"ret=$?; rm -rf /tmp/$$; exit$ret" 0 1 2 3 15
9-
rm -f ./tags
34+
rm -f ./$TAGS_FILE
1035

1136
IS_EXUBERANT=""
1237
ctags --version2>&1| grep Exuberant&& IS_EXUBERANT="Y"
@@ -34,9 +59,17 @@ thenFLAGS="--c-kinds=+dfmstuv"
3459
elseFLAGS="-dt"
3560
fi
3661

62+
# Use -I option to ignore a macro
63+
if ["$IS_EXUBERANT" ]
64+
thenIGNORE_IDENTIFIES="-I pg_node_attr+"
65+
elseIGNORE_IDENTIFIES=
66+
fi
67+
3768
# this is outputting the tags into the file 'tags', and appending
38-
find`pwd`/ -type f -name'*.[chyl]' -print|
39-
xargs ctags -a -f tags"$FLAGS"
69+
find`pwd`/\( -name tmp_install -prune -o -name tmp_check -prune\) \
70+
-o\( -name"*.[chly]" -o -iname"*makefile*" -o -name"*.mk" -o -name"*.in" \
71+
-o -name"*.sql" -o -name"*.p[lm]"\) -type f -print|
72+
xargs ctags$MODE -a -f$TAGS_FILE"$FLAGS""$IGNORE_IDENTIFIES"
4073

4174
# Exuberant tags has a header that we cannot sort in with the other entries
4275
# so we skip the sort step
@@ -45,10 +78,13 @@ find `pwd`/ -type f -name '*.[chyl]' -print |
4578
if [!"$IS_EXUBERANT" ]
4679
thenLC_ALL=C
4780
export LC_ALL
48-
sorttags>/tmp/$$&& mv /tmp/$$tags
81+
sort$TAGS_FILE>/tmp/$$&& mv /tmp/$$$TAGS_FILE
4982
fi
5083

51-
find.\( -name'CVS' -prune\) -o\( -name .git -prune\) -o -type d -print|
52-
whileread DIR
53-
do["$DIR"!="." ]&& ln -f -s`echo"$DIR"| sed's;/[^/]*;/..;g'`/tags"$DIR"/tags
54-
done
84+
# create symbolic links
85+
if [!"$NO_SYMLINK" ]
86+
then find.\( -name'CVS' -prune\) -o\( -name .git -prune\) -o -type d -print|
87+
whileread DIR
88+
do["$DIR"!="." ]&& ln -f -s`echo"$DIR"| sed's;/[^/]*;/..;g'`/$TAGS_FILE"$DIR"/$TAGS_FILE
89+
done
90+
fi

‎src/tools/make_etags

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
#!/bin/sh
2-
32
# src/tools/make_etags
43

5-
command -v etags>/dev/null|| \
6-
{echo"'etags' program not found"1>&2;exit 1; }
7-
8-
rm -f ./TAGS
9-
10-
find`pwd`/ -type f -name'*.[chyl]' -print|
11-
xargs etags --append -o TAGS
12-
13-
find.\( -name CVS -prune\) -o\( -name .git -prune\) -o -type d -print|
14-
whileread DIR
15-
do["$DIR"!="." ]&& ln -f -s`pwd`/TAGS"$DIR"
16-
done
4+
cdir=`dirname$0`
5+
dir=`(cd$cdir&& pwd)`
6+
exec$dir/make_ctags -e$*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp