Skip to content

Commit

Permalink
scripts: refactor remove structure forward declarations
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
hamo authored and michal42 committed Mar 26, 2012
1 parent 98bd462 commit 6697922
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ exuberant()
all_defconfigs | xargs -r $1 -a \
--langdef=dotconfig --language-force=dotconfig \
--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'

# Remove structure forward declarations.
LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' tags
}

emacs()
Expand Down Expand Up @@ -233,6 +230,7 @@ if [ "${ARCH}" = "um" ]; then
fi
fi

remove_structs=
case "$1" in
"cscope")
docscope
Expand All @@ -245,10 +243,17 @@ case "$1" in
"tags")
rm -f tags
xtags ctags
remove_structs=y
;;

"TAGS")
rm -f TAGS
xtags etags
remove_structs=y
;;
esac

# Remove structure forward declarations.
if [ -n $remove_structs ]; then
LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
fi

0 comments on commit 6697922

Please sign in to comment.