From: Harlan Stenn Date: Fri, 5 May 2006 02:28:16 +0000 (-0400) Subject: Clean up/fix the force code X-Git-Tag: NTP_4_2_1P244_RC~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37151550d3f1e982c044b6a01b15a81b23f902ee;p=thirdparty%2Fntp.git Clean up/fix the force code bk: 445ab840DvBB-wrgB1WPFkK8kTv05A --- diff --git a/scripts/genver b/scripts/genver index 3a6bb8367..2b60f0f7d 100755 --- a/scripts/genver +++ b/scripts/genver @@ -4,12 +4,12 @@ # # -f would be 'force the update' -usecmp=true +force=0 outputs= for i in $* do case "$i" in - -f) usecmp=false ;; + -f) force=1 ;; version.m4) outputs="version.m4 $outputs" ;; @@ -37,23 +37,31 @@ set +e case "$outputs" in *version.m4*) echo "m4_define([VERSION_NUMBER],[${dversion}])" > version.m4+ - if $usecmp || cmp version.m4+ version.m4 - then - rm -f version.m4+ - else + cmp version.m4+ version.m4 + rc=$? + case "$force$rc" in + *1*) mv version.m4+ version.m4 - fi + ;; + *) + rm -f version.m4+ + ;; + esac ;; esac case "$outputs" in *version.def*) echo "version = '${dversion}';" > include/version.def+ - if $usecmp || cmp include/version.def+ include/version.def - then - rm -f include/version.def+ - else + cmp include/version.def+ include/version.def + rc=$? + case "$force$rc" in + *1*) mv include/version.def+ include/version.def - fi + ;; + *) + rm -f include/version.def+ + ;; + esac ;; esac