Changeset 544 for branches


Ignore:
Timestamp:
12/15/2011 17:04:10 (5 months ago)
Author:
ccowart
Message:

Reverting change; accidentally went into the 1.9 branch instead of trunk.

See #120.

Location:
branches/confman-1.9
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9/confaudit.in

    r543 r544  
    109109tmproot=$(conf_tmp_dir) 
    110110live_root="${LIVE_ROOT}" 
    111 statefile=$(conf_tmp_file) 
    112111 
    113112# Override LIVE_ROOT to commit into our temporary directory. 
     
    117116for layer in $(conf_get_recipe) ; do 
    118117    echo "Rolling on $layer..." 
    119     conf_rollout $layer $statefile || conf_cleanExit 
     118    conf_rollout $layer || conf_cleanExit 
    120119done 
    121120for file in $SINGULARITIES ; do 
  • branches/confman-1.9/confman.in

    r543 r544  
    189189 
    190190function commit { 
    191     local msg status modules module symlink abswork files statefile 
     191    local msg status modules module symlink abswork files 
    192192    local nocommit=true 
    193193    local opt OPTIND OPTARG 
     
    212212    abswork=$(conf_abswork) 
    213213     
    214     for module in $(conf_get_reverse_recipe); do 
     214    for module in $(conf_get_recipe); do 
    215215        modules=${modules:+${modules} }${module} 
    216216        for symlink in $(find ${WORK_PATH}/${module} \ 
     
    236236    echo "Commit operation started" >&2 
    237237    $nocommit || conf_commit_file $msg $files || return $? 
    238     statefile=$(conf_tmp_file) 
    239     for layer in $(conf_get_reverse_recipe) ; do 
     238    for layer in $(conf_get_recipe) ; do 
    240239        echo "Rolling on $layer..." 
    241         conf_rollout $layer $statefile || return $? 
     240        conf_rollout $layer || return $? 
    242241    done 
    243242    for file in $SINGULARITIES ; do 
     
    260259    local opt OPTIND OPTARG 
    261260    local module 
    262     local statefile 
    263261 
    264262    while getopts ":m:F:" opt ; do 
     
    294292    $nocommit || conf_commit_file "$msg" "$files" || return $? 
    295293     
    296     for layer in $(conf_get_reverse_recipe) ; do 
     294    for layer in $(conf_get_recipe) ; do 
    297295        for file in "$@"; do 
    298296            module=$(conf_wfile_module $file) 
    299297            if conf_wfile_is_singularity $file; then 
    300                 conf_install $layer $statefile "${file%-$module}-${layer}" 
     298                conf_install $layer "${file%-$module}-${layer}" 
    301299            else 
    302                 conf_install $layer $statefile "$file" 
     300                conf_install $layer "$file" 
    303301            fi 
    304302        done 
     
    763761    local checkpoint=$2 
    764762    local clock=$3 
    765     local wcopy_lock system_lock statefile 
     763    local wcopy_lock system_lock 
    766764 
    767765    if [ -z "$2" ] ; then 
     
    773771        echo "Rolling $module back to $checkpoint $clock" >&2 
    774772        conf_rollback $module $checkpoint $clock || conf_cleanExit 
    775         statefile=$(conf_tmp_file) 
    776         for layer in $(conf_get_reverse_recipe) ; do 
     773        for layer in $(conf_get_recipe) ; do 
    777774            echo "Rolling on $layer..." 
    778             conf_rollout $layer $statefile || conf_cleanExit 
     775            conf_rollout $layer || conf_cleanExit 
    779776        done 
    780777 
     
    928925        local tmproot=$(conf_tmp_dir) 
    929926        local live_root="${LIVE_ROOT}" 
    930         local statefile 
    931927 
    932928        # Override LIVE_ROOT to commit into our tmporary directory. 
     
    936932 
    937933        echo "Audit operation started" >&2 
    938         for layer in $(conf_get_reverse_recipe) ; do 
     934        for layer in $(conf_get_recipe) ; do 
    939935            echo "Rolling on $layer..." 
    940             conf_rollout $layer $statefile || return $? 
     936            conf_rollout $layer || return $? 
    941937        done >/dev/null 
    942938        for file in $SINGULARITIES ; do 
  • branches/confman-1.9/confmanlib.sh.in

    r543 r544  
    414414} 
    415415 
    416 # Test to see if the pathname has been added to a statefile yet 
    417 function conf_beenthere { 
    418     local statefile="$1" 
    419     local pathname="$2" 
    420     fgrep -q "$pathname" "$statefile" 
    421 } 
    422  
    423 # Record this file in the given statefile 
    424 function conf_gothere { 
    425     local statefile="$1" 
    426     local pathname="$2" 
    427     echo "$pathname" >> $statefile 
    428 } 
    429  
    430416# Roll out the specified module, optionally at the specified checkpoint 
    431 # A statefile is a place to record the files that have been rolled out to 
    432 # prevent a lower-priority module from installing a committed file. 
    433 # eg:   conf_rollout MODULE STATEFILE [checkpoint] 
     417# eg:   conf_rollout MODULE [checkpoint] 
    434418function conf_rollout { 
    435419        local module="$1" 
    436     local statefile="$2" 
    437         if [ -z $3 ] ; then 
     420        if [ -z $2 ] ; then 
    438421                local moduledir="${WORK_PATH}/$module" 
    439422        else  
     
    453436                local livedir=`echo $directory | ${sed_cmd} -e "s:$moduledir::"` 
    454437                livedir="${LIVE_ROOT}${livedir}" 
    455         if ! conf_beenthere $statefile "$livedir" ; then 
    456                     local owner=`conf_get_prop ${directory} owner` 
    457                     local group=`conf_get_prop ${directory} group` 
    458                     local mode=`conf_get_prop ${directory} mode` 
    459                     local opts="-d -o $owner -g $group -m $mode" 
    460                     local cmd="$SUDO $install_cmd $opts $livedir" 
    461                     echo $cmd 
    462             conf_gothere $statefile "$livedir" 
    463                     $cmd 
    464         fi 
    465         done     
     438                local owner=`conf_get_prop ${directory} owner` 
     439                local group=`conf_get_prop ${directory} group` 
     440                local mode=`conf_get_prop ${directory} mode` 
     441                local opts="-d -o $owner -g $group -m $mode" 
     442                local cmd="$SUDO $install_cmd $opts $livedir" 
     443                echo $cmd 
     444                $cmd 
     445        done 
    466446        for file in `find -L $moduledir -type f | grep -v "\.svn"` ; do 
    467447                local livefile=`echo "$file" | ${sed_cmd} -e "s:$moduledir::"` 
     
    470450                local mode=`conf_get_prop ${file} mode` 
    471451        local symlink="`conf_get_prop ${file} symlink`" 
    472         livefile="${LIVE_ROOT}${livefile}" 
    473         if ! conf_beenthere $statefile "$livefile" ; then 
    474             file=`$readlink_cmd -m $file` 
    475             if [ -n "$symlink" ]; then 
    476                 local cmd="$SUDO ln -snf $symlink $livefile" 
    477             else 
    478                         local opts="-o $owner -g $group -m $mode" 
    479                         local cmd="$SUDO $install_cmd $opts $file $livefile" 
    480             fi 
     452        file=`$readlink_cmd -m $file` 
     453        if [ -n "$symlink" ]; then 
     454            local cmd="$SUDO ln -snf $symlink ${LIVE_ROOT}$livefile" 
     455            echo $cmd 
     456            $cmd 
     457        else 
     458                    local opts="-o $owner -g $group -m $mode" 
     459                    local cmd="$SUDO $install_cmd $opts $file ${LIVE_ROOT}$livefile" 
    481460                    echo $cmd 
    482             conf_gothere $statefile "$livefile" 
    483461                    $cmd 
    484462        fi 
     
    561539    ABS_WORK=$(${readlink_cmd} -m "$WORK_PATH") 
    562540        local module="$1" 
    563     local statefile="$2" 
    564     local file="$3" 
     541    local file="$2" 
    565542    shift 2 
    566543    local livefile 
     
    576553    livefile="/${file#*/}" 
    577554    file="${ABS_WORK}/${module}${livefile}" 
    578     livefile="${LIVE_ROOT}${livefile}" 
    579555 
    580556        # See if it even exists 
    581557    if [ ! -e "$file" ] ; then 
    582558        conf_debug "$file" does not appear to exist 
    583         conf_install $module $statefile "$@" 
     559        conf_install $module "$@" 
    584560        return 1 
    585561    fi 
     
    598574     
    599575    if [ -n "$symlink" ] ; then 
    600         local cmd="$SUDO ln -snf $symlink $livefile" 
    601     else 
    602             local cmd="$SUDO $install_cmd $opts $file $livefile" 
    603     fi 
    604  
    605     if ! conf_beenthere $statefile "$livefile" ; then 
    606             ${NFS_HACK:-false} && chmod o+rx ${ABS_WORK} 
    607             echo $cmd 
    608         conf_gothere $statefile "$lifefile" 
    609             $cmd || failures=true 
    610             ${NFS_HACK:-false} && chmod o-rx ${ABS_WORK} 
    611     fi 
     576        local cmd="$SUDO ln -snf $symlink ${LIVE_ROOT}$livefile" 
     577    else 
     578            local cmd="$SUDO $install_cmd $opts $file ${LIVE_ROOT}$livefile" 
     579    fi 
     580 
     581        ${NFS_HACK:-false} && chmod o+rx ${ABS_WORK} 
     582        echo $cmd 
     583        $cmd || failures=true 
     584        ${NFS_HACK:-false} && chmod o-rx ${ABS_WORK} 
    612585 
    613586    if [ -d "$file" ] ; then 
    614587        conf_debug "conf_install encountered a directory. Recursing." 
    615         conf_install $module $statefile $(find "$file" \ 
     588        conf_install $module $(find "$file" \ 
    616589            -mindepth 1 -maxdepth 1 -not -name '.svn') || failures=true 
    617590    fi 
    618591    conf_debug "conf_install recursing" 
    619         conf_install $module $statefile "$@" || failures=true 
     592        conf_install $module "$@" || failures=true 
    620593    conf_debug "conf_install returning" 
    621594    if $failures ; then  
     
    10401013} 
    10411014 
    1042 # Gets a reversed copy of the recipe 
    1043 function conf_get_reverse_recipe { 
    1044     local fwd_recipe=$(conf_get_recipe "$@") 
    1045     local rev_recipe 
    1046     for module in $fwd_recipe ; do 
    1047         rev_recipe="$module $rev_recipe" 
    1048     done 
    1049     echo $rev_recipe 
    1050 } 
    1051  
    10521015# Spits the recipe, modules separated by whitespace, out on stdout 
    10531016function conf_get_recipe { 
  • branches/confman-1.9/confsync.in

    r543 r544  
    116116sys_revision=`conf_sysrev` 
    117117last_action=$(conf_lastact) 
    118 statefile=$(conf_tmp_file) 
    119118 
    120119if [ "x$last_action" = "xinstall" ] && [ $tar_revision -lt $sys_revision ] 
     
    140139for layer in $(conf_get_recipe) ; do 
    141140    echo "Rolling on $layer..." 
    142     conf_rollout $layer $statefile || conf_cleanExit 
     141    conf_rollout $layer || conf_cleanExit 
    143142done 
    144143for file in $SINGULARITIES ; do 
Note: See TracChangeset for help on using the changeset viewer.