File: replaceRenamedDeprecated.sh

package info (click to toggle)
kde-dev-scripts 4%3A18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,496 kB
  • sloc: perl: 15,466; lisp: 5,627; sh: 4,157; python: 3,892; ruby: 2,158; makefile: 16; sed: 9
file content (16 lines) | stat: -rwxr-xr-x 423 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# I do not assert any rights on these few trivial lines of code, Reinhold Kainhofer

# replace old function names with new function names, when all parameters stay the same
#e.g.:
# ./replaceRenamedDeprecated.sh setColumnStretch setColumnStretch

old="$1"
new="$2"

for i in `grep -rle "$1" [ac-z]* | grep -v '\.svn'`; do
  sed "s/$1/$2/g" "$i" > "$i".new;
	echo "$i";
	diff "$i" "$i".new;
	mv "$i".new "$i"
done