Skip to content

Commit 6697922

Browse files
hamomichal42
authored andcommitted
scripts: refactor remove structure forward declarations
Since now it has some problems when generate TAGS, refactor this code. Now it will not show the error message and will remove declarations using emacs etags. Signed-off-by: Yang Bai <hamo.by@gmail.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 98bd462 commit 6697922

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/tags.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@ exuberant()
166166
all_defconfigs | xargs -r $1 -a \
167167
--langdef=dotconfig --language-force=dotconfig \
168168
--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'
169-
170-
# Remove structure forward declarations.
171-
LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' tags
172169
}
173170

174171
emacs()
@@ -233,6 +230,7 @@ if [ "${ARCH}" = "um" ]; then
233230
fi
234231
fi
235232

233+
remove_structs=
236234
case "$1" in
237235
"cscope")
238236
docscope
@@ -245,10 +243,17 @@ case "$1" in
245243
"tags")
246244
rm -f tags
247245
xtags ctags
246+
remove_structs=y
248247
;;
249248

250249
"TAGS")
251250
rm -f TAGS
252251
xtags etags
252+
remove_structs=y
253253
;;
254254
esac
255+
256+
# Remove structure forward declarations.
257+
if [ -n $remove_structs ]; then
258+
LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
259+
fi

0 commit comments

Comments
 (0)