File: ExtraQualFixer.sh

package info (click to toggle)
spring 103.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 43,720 kB
  • ctags: 63,685
  • sloc: cpp: 368,283; ansic: 33,988; python: 12,417; java: 12,203; awk: 5,879; sh: 1,846; xml: 655; perl: 405; php: 211; objc: 194; makefile: 77; sed: 2
file content (27 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Author: Tobi Vollebregt

# Use to fix errors like these (occuring with gcc >= 4.1):
# error: extra qualification 'CSpotFinder::' on member 'GetBestCachePoint'
# Pipe output of build process into it, ie.
#	buildtool -k | ./ExtraQualFixer.sh
# Use -k to keep build going on errors.
# This way all extra qualification errors are fixed in one pass.
# Replace buildtool with scons, make, whatever you use.

tmp=.ExtraQualFixer.tmp
grep 'error: extra qualification ' | sort | uniq > "$tmp"

IFS='
'
for line in $(cat "$tmp");
do
	# figure out symbol name, with and without extra qualification
	symbolwq=$(echo "$line" | awk -F \' '{print $2 $4}')
	symbolwoq=$(echo "$symbolwq" | sed 's/.*:://g')
	# figure out the filename
	file=$(echo "$line" | awk -F ':' '{print $1}')
	# replace symbol with extra qual. with symbol without extra qual.
	sed -i "s/$symbolwq/$symbolwoq/g" "$file"
done
rm "$tmp"