-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nuke_format, a tool to vaporize a format. Tested on yahoo and map…
…send.
- Loading branch information
1 parent
40429dd
commit d9dcfd9
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# usage nuke_format format_name | ||
|
||
SED=$(which gsed) | ||
EDITOR="${EDITOR:-vim}" | ||
|
||
# $1 = format $2 = file | ||
remove_word() { | ||
# git add $2 | ||
$SED -i "s/$1//g" $2 | ||
} | ||
|
||
remove_line_containing() { | ||
# git add $2 | ||
$SED -i "/$1/d" $2 | ||
} | ||
|
||
# For things it's easier to just edit away.:1 | ||
remove_manually() { | ||
grep $1 $2 && $EDITOR +/$1 $2 | ||
# git add $2 | ||
} | ||
|
||
remove_word $1.cc CMakelists.txt | ||
remove_word $1.h CMakelists.txt | ||
remove_word $1.cc GPSBabel.pro | ||
remove_word $1.h GPSBabel.pro | ||
|
||
remove_manually $1 reference/help.txt | ||
|
||
remove_line_containing $1 reference/format0.txt | ||
remove_line_containing $1 reference/format1.txt | ||
remove_line_containing $1 reference/format2.txt | ||
remove_manually $1 reference/format3.txt | ||
remove_line_containing extern.*$1 vecs.h | ||
remove_line_containing Format.*$1 vecs.h | ||
remove_line_containing include.*$1 vecs.h | ||
remove_manually $1 reference/format3.txt | ||
remove_line_containing $1 msvc/GPSBabel.vcxproj | ||
remove_line_containing $1 msvc/GPSBabel.vcxproj.filters | ||
|
||
git rm -f reference/$1* | ||
git rm -f xmldoc/formats/$1.xml | ||
git rm -f xmldoc/formats/options/$1.xml | ||
git rm -f testo.d/$1.test | ||
git rm -f $1.cc | ||
git rm -f $1.h | ||
|
||
# make && ./testo |