Changeset 537 for trunk


Ignore:
Timestamp:
08/21/2011 18:28:01 (9 months ago)
Author:
blee
Message:

Consolidate confsync revision comparison code.

This also catches the case where the revision numbers are equal
but the last action was an install, in which case confsync should run.

Fixes #147

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/confsync.in

    r508 r537  
    1 #!@BASH@ 
     1#!@BASH@ -x 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
     
    117117last_action=$(conf_lastact) 
    118118 
    119 if [ "x$last_action" = "xinstall" ] && [ $tar_revision -lt $sys_revision ] 
    120 then 
    121     echo "Error: File system may be dirty." \ 
    122         "A commit operation is recommended." >&2 
    123     echo "Error: $tarpath is out of date. Exiting without making changes." >&2 
    124     conf_markdirty 
    125     conf_cleanExit 1 
    126 fi 
    127  
    128 if [ -n "$sys_revision" ] ; then 
    129     if $FORCE && [ $tar_revision -lt $sys_revision ] ; then 
    130         echo "Error: $tarpath is out of date. Exiting without making changes." >&2 
     119if [ -n "${sys_revision}" ] ; then 
     120    if [ "${tar_revision}" -lt "${sys_revision}" ]; then 
     121        echo "Error: ${tarpath} is out of date. Exiting without making changes." >&2 
     122        conf_markdirty 
    131123        conf_cleanExit 1 
    132     elif ! $FORCE && [ $tar_revision -le $sys_revision ] ; then 
    133         $QUIET || echo "System is up to date." | conf_logger 
    134         conf_cleanExit 0 
     124    elif ! ${FORCE} && [ "${tar_revision}" -eq "${sys_revision}" ]; then 
     125        if [ "${last_action}" = "commit" ]; then 
     126            ${QUIET} || echo "System is up to date." | conf_logger 
     127            conf_cleanExit 0 
     128        fi 
    135129    fi 
    136130fi 
Note: See TracChangeset for help on using the changeset viewer.