From d240259bb7a99236ccadeb1b875672d74c692f4c Mon Sep 17 00:00:00 2001 From: thib Date: Mon, 1 Jan 2007 18:51:53 +0000 Subject: [PATCH] better handling of the PREVIOUS_VERSION file --- script/boot-install | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/script/boot-install b/script/boot-install index fd53655..d3c9bdb 100755 --- a/script/boot-install +++ b/script/boot-install @@ -2,7 +2,7 @@ # Install fcron under SysV system. # -# $Id: boot-install,v 1.38 2004-01-29 10:36:00 thib Exp $ +# $Id: boot-install,v 1.39 2007-01-01 18:51:53 thib Exp $ # takes 6 arguments : the name of the BSD-like install program (with "-o" and the correct username) # the DESTSBIN directory @@ -50,16 +50,19 @@ fi # Check now if there is an old ( < 1.1.x ) version of fcrontab on the system. # We do that here because if user say "no" too early, the PREVIOUS_VERSION would # not be removed. -if test -r "$SRCDIR/script/PREVIOUS_VERSION"; then - MAJOR=`cat $SRCDIR/script/PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $1}'` - MINOR=`cat $SRCDIR/script/PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $2}'` -# echo "MINOR $MINOR MAJOR $MAJOR" - if test \( "$MAJOR" -lt 1 \) -o \( \( "$MINOR" -lt 1 \) -a "$MAJOR" -eq 1 \); then +if test -r "PREVIOUS_VERSION"; then + MAJOR=`cat PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $1}'` + MINOR=`cat PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $2}'` + #echo "MINOR $MINOR MAJOR $MAJOR" + if test "x$MAJOR" = "x" -a "x$MINOR" = "x"; then + # we don't have the version: there was no previous fcron installed + NEED_UPDATE=0 + elif test \( "$MAJOR" -lt 1 \) -o \( \( "$MINOR" -lt 1 \) -a "$MAJOR" -eq 1 \); then NEED_UPDATE=1 else NEED_UPDATE=0 fi - rm -f $SRCDIR/script/PREVIOUS_VERSION + rm -f PREVIOUS_VERSION else NEED_UPDATE=1 fi -- 2.40.0