Changeset 541


Ignore:
Timestamp:
12/15/2011 16:24:45 (5 months ago)
Author:
blee
Message:

add CONF_COMMIT_REPO_ONLY option, fixes #122

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/confman.conf.5.in

    r525 r541  
    206206.Cm confman update 
    207207will update only the recipe-relevant files when given no additional arguments. 
     208.It CONF_COMMIT_REPO_ONLY 
     209Defaults to "false".  Set it to "true" to change the behavior of 
     210.Xr confman 8 
     211"commit" to a repository-only operation, with no regard for the current 
     212machine's recipe or the subsequent rollout to the filesystem.  This is 
     213useful in centrally managed confexport/confsync environments. 
    208214.El 
    209215.Sh AUTHORS 
  • trunk/confman.conf.in

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

    r536 r541  
    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        msg=$(get_log "$status") || conf_cleanExit 
     236        rm -f "$status" 
     237    fi 
     238 
     239    echo "Commit operation started" >&2 
     240 
     241    conf_commit_file $msg "${WORK_PATH}" || return $? 
     242 
     243    echo "Commit operation finished successfully" >&2 
     244 
     245    rm -f $msg 
     246    conf_unlock_wcopy $wcopy_lock 
     247} 
     248 
     249function commit_full { 
    214250    local msg status modules module symlink abswork files 
    215251    local nocommit=true 
     
    274310    conf_unlock_wcopy $wcopy_lock 
    275311    conf_unlock_system $system_lock 
     312} 
     313 
     314function commit { 
     315    if ${CONF_COMMIT_REPO_ONLY}; then 
     316        commit_repo_only "$@" || return $? 
     317    else 
     318        commit_full "$@" || return $? 
     319    fi 
    276320} 
    277321 
Note: See TracChangeset for help on using the changeset viewer.