Changeset 526


Ignore:
Timestamp:
08/14/2011 17:41:50 (9 months ago)
Author:
blee
Message:

confexport now records the export style used in addition to the revision.

This catches export style changes, which need CONF_EXPORT_INCREMENTAL
disabled. This also means confexport runs when the administrator changes
the export style but the repository revision hasn't changed.

See #140

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/confexport.in

    r525 r526  
    101101conf_checkout_tree 
    102102 
    103 export_revision=$(conf_revision) 
    104 sys_revision=$(conf_export_sysrev) 
     103repo_export="${CONF_EXPORT_STYLE}:$(conf_revision)" 
     104sys_export="$(conf_export_sysrev)" 
    105105 
    106 conf_debug "export_revision is ${export_revision}" 
    107 conf_debug "sys_revision is ${sys_revision}" 
     106conf_debug "repo_export: ${repo_export}" 
     107conf_debug "sys_export: ${sys_export}" 
    108108 
    109 if [ "${sys_revision}" -gt "${export_revision}" ]; then 
    110     echo "Error: The last export was newer than the current repository.  Exiting without making changes." >&2 
    111     conf_cleanExit 1 
    112 elif [ "${sys_revision}" -eq "${export_revision}" ]; then 
     109if [ "${sys_export}" = "${repo_export}" ]; then 
    113110    if ! ${FORCE}; then 
    114111        echo "System is up to date." | conf_logger 
     
    117114fi 
    118115 
    119 if ! conf_export "${temp_conf_export}" "${sys_revision}" "${export_revision}"; then 
     116repo_method=$(echo ${repo_export} | cut -d ':' -f 1) 
     117sys_method=$(echo ${sys_export} | cut -d ':' -f 1) 
     118repo_revision=$(echo ${repo_export} | cut -d ':' -f 2) 
     119sys_revision=$(echo ${sys_export} | cut -d ':' -f 2) 
     120 
     121if [ "${sys_method}" != "${repo_method}" ]; then 
     122    echo "Export style change detected: ${sys_method} -> ${repo_method}" 
     123    if ${CONF_EXPORT_INCREMENTAL}; then 
     124        echo "Ignoring CONF_EXPORT_INCREMENTAL during export style change" 
     125        CONF_EXPORT_INCREMENTAL="false" 
     126    fi 
     127fi 
     128 
     129if [ "${sys_revision}" -gt "${repo_revision}" ]; then 
     130    echo "Error: The last export was newer than the current repository.  Exiting without making changes." >&2 
     131    conf_cleanExit 1 
     132fi 
     133 
     134if ! conf_export "${temp_conf_export}" "${sys_revision}" "${repo_revision}"; then 
    120135    echo "Error: The export failed. Exiting." >&2 
    121136    rm -rf "${temp_conf_export}" 
  • trunk/confmanlib.sh.in

    r525 r526  
    11001100    local rv 
    11011101 
    1102     export_sysrev=0 
     1102    export_sysrev="none:0" 
    11031103    rv=0 
    11041104 
     
    11061106        if ! export_sysrev=$(cat "${EXPORT_REV_FILE}"); then 
    11071107            echo "Could not read file: ${EXPORT_REV_FILE}" >&2 
    1108             export_sysrev=0 
     1108            export_sysrev="none:0" 
    11091109            rv=1 
    11101110        fi 
    11111111    fi 
    11121112 
    1113     echo ${export_sysrev} 
     1113    echo "${export_sysrev}" 
    11141114    return ${rv} 
    11151115} 
     
    11351135    local revision=$(conf_revision) 
    11361136 
    1137     if ! echo "${revision}" > "${EXPORT_REV_FILE}"; then 
     1137    if ! echo "${CONF_EXPORT_STYLE}:${revision}" > "${EXPORT_REV_FILE}"; then 
    11381138            echo "Could not record export to file: ${EXPORT_REV_FILE}" >&2 
    11391139            return 1 
Note: See TracChangeset for help on using the changeset viewer.