ruby-changes:3746
From: ko1@a...
Date: Fri, 25 Jan 2008 19:22:44 +0900 (JST)
Subject: [ruby-changes:3746] nobu - Ruby:r15235 (trunk): * tool/ifchange: commit miss.
nobu 2008-01-25 19:22:32 +0900 (Fri, 25 Jan 2008) New Revision: 15235 Added files: trunk/tool/ifchange Log: * tool/ifchange: commit miss. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/tool/ifchange?revision=15235&view=markup http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/tool/ifchange?r1=15235&r2=15234&diff_format=u Index: tool/ifchange =================================================================== --- tool/ifchange (revision 0) +++ tool/ifchange (revision 15235) @@ -0,0 +1,16 @@ +#!/bin/sh +# usage: ifchange target temporary + +target="$1" +temp="$2" +if [ "$temp" = - ]; then + temp="tmpdata$$.tmp~" + cat > "$temp" || exit $? + trap 'rm -f "$temp"' 0 +fi +if cmp "$target" "$temp" >/dev/null 2>&1; then + echo "$target unchanged" +else + echo "$target updated" + mv -f "$temp" "$target" +fi Property changes on: tool/ifchange ___________________________________________________________________ Name: svn:eol-style + LF Name: svn:executable + * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/