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

Commit87f21d2

Browse files
committed
Fix make_etags failure on Mac.
Previously make_etags always ran make_ctags -e when make_etags wasexecuted. However, because non-Exuberant ctags on Mac does notsupport -e option (and also on other platforms including old Linux),ctags failed. To avoid the failure change make_ctags so that ifnon-Exuberant ctags is used and ctags -e option is requested, runetags command instead. If etags command does not exist, make_ctagswill fail.Also refactor make_ctags and tweak make_etags to emit proper usagemessage.Author: Fujii MasaoReviewed-by: Tatsuo IshiiDiscussion:https://www.postgresql.org/message-id/369c13b9-8b0f-d6f9-58fc-61258ec8f713%40oss.nttdata.com
1 parent3b12e68 commit87f21d2

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

‎src/tools/make_ctags

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ thenecho $usage
99
exit 1
1010
fi
1111

12-
MODE=
12+
EMACS_MODE=
1313
NO_SYMLINK=
14+
IS_EXUBERANT=
15+
PROG="ctags"
16+
TAGS_OPT="-a -f"
1417
TAGS_FILE="tags"
18+
FLAGS=
19+
IGNORE_IDENTIFIES=
1520

1621
while [$#-gt 0 ]
1722
do
1823
if [$1="-e" ]
19-
thenMODE="-e"
20-
TAGS_FILE="TAGS"
24+
thenEMACS_MODE="Y"
2125
elif [$1="-n" ]
2226
thenNO_SYMLINK="Y"
2327
else
@@ -27,15 +31,24 @@ do
2731
shift
2832
done
2933

30-
command -v ctags>/dev/null|| \
34+
if [!"$EMACS_MODE" ]
35+
then(command -v ctags>/dev/null)|| \
3136
{echo"'ctags' program not found"1>&2;exit 1; }
37+
fi
3238

33-
trap"ret=$?; rm -rf /tmp/$$; exit$ret" 0 1 2 3 15
34-
rm -f ./$TAGS_FILE
35-
36-
IS_EXUBERANT=""
3739
ctags --version2>&1| grep Exuberant&& IS_EXUBERANT="Y"
3840

41+
if ["$EMACS_MODE" ]
42+
thenTAGS_FILE="TAGS"
43+
if ["$IS_EXUBERANT" ]
44+
then PROG="ctags -e"
45+
else(command -v etags>/dev/null)|| \
46+
{echo"neither 'etags' nor exuberant 'ctags' program not found"1>&2;exit 1; }
47+
PROG="etags"
48+
TAGS_OPT="-a -o"
49+
fi
50+
fi
51+
3952
# List of kinds supported by Exuberant Ctags 5.8
4053
# generated by ctags --list-kinds
4154
# --c-kinds was called --c-types before 2003
@@ -56,20 +69,23 @@ ctags --version 2>&1 | grep Exuberant && IS_EXUBERANT="Y"
5669

5770
if ["$IS_EXUBERANT" ]
5871
thenFLAGS="--c-kinds=+dfmstuv"
59-
elseFLAGS="-dt"
72+
elif [!"$EMACS_MODE" ]
73+
thenFLAGS="-dt"
6074
fi
6175

6276
# Use -I option to ignore a macro
6377
if ["$IS_EXUBERANT" ]
6478
thenIGNORE_IDENTIFIES="-I pg_node_attr+"
65-
elseIGNORE_IDENTIFIES=
6679
fi
6780

81+
trap"ret=$?; rm -rf /tmp/$$; exit$ret" 0 1 2 3 15
82+
rm -f ./$TAGS_FILE
83+
6884
# this is outputting the tags into the file 'tags', and appending
6985
find`pwd`/\( -name tmp_install -prune -o -name tmp_check -prune\) \
7086
-o\( -name"*.[chly]" -o -iname"*makefile*" -o -name"*.mk" -o -name"*.in" \
7187
-o -name"*.sql" -o -name"*.p[lm]"\) -type f -print|
72-
xargsctags$MODE -a -f$TAGS_FILE"$FLAGS""$IGNORE_IDENTIFIES"
88+
xargs$PROG$TAGS_OPT$TAGS_FILE$FLAGS$IGNORE_IDENTIFIES
7389

7490
# Exuberant tags has a header that we cannot sort in with the other entries
7591
# so we skip the sort step

‎src/tools/make_etags

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
2-
# src/tools/make_etags
2+
3+
# src/tools/make_etags [-n]
4+
5+
if [$#-gt 1 ]|| ( [$#-eq 1 ]&& [$1!="-n" ] )
6+
thenecho"Usage:$0 [-n]"
7+
exit 1
8+
fi
39

410
cdir=`dirname$0`
511
dir=`(cd$cdir&& pwd)`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp