repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* include/ruby/io.h (rb_io_t): new fields: writeconv,
[ruby-svn.git]
/
tool
/
ifchange
blob
544513ad157d027a6337ea8f2ddaae8c10e82ef0
1
#!/bin/sh
2
# usage: ifchange target temporary
3
4
target
=
"
$1
"
5
temp
=
"
$2
"
6
if
[
"
$temp
"
= - ];
then
7
temp
=
"tmpdata$$.tmp~"
8
cat
>
"
$temp
"
||
exit
$?
9
trap
'rm -f "
$temp
"'
0
10
fi
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
"
17
fi