* include/ruby/encoding.h (rb_econv_check_error): declared.
[ruby-svn.git] / tool / ifchange
blob544513ad157d027a6337ea8f2ddaae8c10e82ef0
1 #!/bin/sh
2 # usage: ifchange target temporary
4 target="$1"
5 temp="$2"
6 if [ "$temp" = - ]; then
7 temp="tmpdata$$.tmp~"
8 cat > "$temp" || exit $?
9 trap 'rm -f "$temp"' 0
11 if cmp "$target" "$temp" >/dev/null 2>&1; then
12 echo "$target unchanged"
13 rm -f "$temp"
14 else
15 echo "$target updated"
16 mv -f "$temp" "$target"