Changeset 567 for branches


Ignore:
Timestamp:
12/16/2011 18:25:56 (5 months ago)
Author:
blee
Message:

Merge fix for #122 into confman-1.9.

Closes #122

Location:
branches/confman-1.9
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/confman.conf.5.in

    r565 r567  
    213213.Cm confman update 
    214214will update only the recipe-relevant files when given no additional arguments. 
     215.It CONF_COMMIT_REPO_ONLY 
     216Defaults to "false".  Set it to "true" to change the behavior of 
     217.Xr confman 8 
     218"commit" to a repository-only operation, with no regard for the current 
     219machine's recipe or the subsequent rollout to the filesystem.  This is 
     220useful in centrally managed confexport/confsync environments. 
    215221.El 
    216222.Sh AUTHORS 
  • branches/confman-1.9/confman.conf.in

    r565 r567  
    110110UPDATE_RELEVANT_ONLY="false" 
    111111 
     112# In centrally managed confexport/confsync environments, the expected 
     113# behavior of a "confman commit" is a repository-only operation, with 
     114# with no regard for the current machine's recipe or the subsequent 
     115# rollout to the filesystem. 
     116CONF_COMMIT_REPO_ONLY="false" 
  • branches/confman-1.9/confman.in

    r566 r567  
    197197        cd "$WORK_PATH" 
    198198        until [ -z "$1" ] ; do 
    199             @SVN@ status "${1#${ABS_WORK}/}" >> "$status" 
     199            @SVN@ status "${1#${ABS_WORK}/}" | egrep -v "^\?" >> "$status" 
    200200            shift 
    201201        done 
     
    211211} 
    212212 
    213 function commit { 
     213function commit_repo_only { 
     214    local msg status abswork 
     215    local opt OPTIND OPTARG 
     216    local wcopy_lock 
     217 
     218    wcopy_lock=$(conf_lock_wcopy) 
     219    abswork=$(conf_abswork) 
     220 
     221    while getopts ":m:F:" opt ; do 
     222        case $opt in 
     223            m)  LOG_MESSAGE="$OPTARG"; LOG_MESSAGE_SET="true" ;; 
     224            F)  LOG_FILE="$OPTARG" ;; 
     225            *)  echo "Invalid option '-${OPTARG}'." >&4 
     226                print_usage 1 
     227                ;; 
     228        esac 
     229    done 
     230    shift $(($OPTIND - 1)) 
     231 
     232    [ -z "$1" ] || print_usage 1 
     233 
     234    if status=$(get_status "${abswork}"); then 
     235        nocommit=false 
     236        msg=$(get_log "$status") || conf_cleanExit 
     237        rm -f "$status" 
     238    fi 
     239 
     240    echo "Commit operation started" >&2 
     241 
     242    $nocommit || conf_commit_file $msg "${abswork}" || return $? 
     243 
     244    echo "Commit operation finished successfully" >&2 
     245 
     246    rm -f $msg 
     247    conf_unlock_wcopy $wcopy_lock 
     248} 
     249 
     250function commit_full { 
    214251    local msg status modules module symlink abswork files 
    215252    local nocommit=true 
     
    274311    conf_unlock_wcopy $wcopy_lock 
    275312    conf_unlock_system $system_lock 
     313} 
     314 
     315function commit { 
     316    if ${CONF_COMMIT_REPO_ONLY}; then 
     317        commit_repo_only "$@" || return $? 
     318    else 
     319        commit_full "$@" || return $? 
     320    fi 
    276321} 
    277322 
Note: See TracChangeset for help on using the changeset viewer.