Changeset 348


Ignore:
Timestamp:
06/23/2009 18:15:20 (3 years ago)
Author:
blee
Message:

Merge confaudit changes from trunk.

Fixes #36, #37, #38

Location:
branches/confman-1.9
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/abspath.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/confman-1.9/confaudit.in

    r326 r348  
    3535 
    3636function print_help { 
    37     echo "usage: $0 [-q]" >&4 
     37    echo "usage: $0 [-d] [-q]" >&4 
    3838    exit ${1:-0} 
    3939} 
     
    4242while getopts "qh" opt 2>&4 ; do 
    4343    case $opt in  
     44        d) DEBUG=true ;; 
    4445        q) quiet=true ;; 
    4546        h) print_help 0 ;; 
     
    4849done 
    4950 
     51trap "conf_cleanExit" EXIT 
     52# If we're in debug mode, we should log stderr messages to the logger 
     53# as well. Otherwise, we send them to the bit bucket. 
     54if $DEBUG ; then 
     55    exec 1>&2 
     56else 
     57    exec 1>/dev/null 
     58fi 
     59 
    5060conf_lock_system 
     61 
     62# Set up our "Working Copy" 
    5163tarball=$(conf_fetch) 
    52 if ! [ -s $tarball ]  
    53 then 
     64if ! [ -s $tarball ] ; then 
    5465    echo "Could not fetch the tarball." >&2 
    5566    exit 1 
    5667fi 
    5768 
    58 export WORK_PATH=$(conf_tmp_dir) 
    59 export LIVE_ROOT=$(conf_tmp_dir) 
     69WORK_PATH=$(conf_tmp_dir) 
     70LIVE_ROOT=$(conf_tmp_dir) 
    6071 
    6172tar -xzf $tarball -C $WORK_PATH 
    6273rm -rf $tarball 
    6374 
     75echo "Audit operation started" | conf_logger 
    6476for layer in $(conf_get_recipe) ; do 
    6577    echo "Rolling on $layer..." 
    66     conf_rollout $layer || return $? 
     78    conf_rollout $layer || conf_cleanExit 
    6779done 
    6880for file in $SINGULARITIES ; do 
    69     conf_assemble_sing $file || return $? 
     81    echo "Assembling singularity $file..." 
     82    conf_assemble_sing $file || conf_cleanExit 
    7083done 
     84rm -rf $WORK_PATH 
    7185 
    72 rm -rf $WORK_PATH 
    73 if $quiet 
    74 then 
    75     $SUDO /usr/bin/diff -rPu / $LIVE_ROOT | grep -v "^Only in" 
     86if $quiet; then 
     87    diff -ruq / $LIVE_ROOT | grep -v "^Only in" >&2 
    7688else 
    77     $SUDO /usr/bin/diff -rPuq / $LIVE_ROOT | grep -v "^Only in" 
     89    diff -ru / $LIVE_ROOT | grep -v "^Only in" >&2 
    7890fi 
     91echo "Audit operation finished successfully" | conf_logger 
    7992 
    8093conf_unlock_system 
    81 $SUDO rm -rf $LIVE_ROOT 
    8294 
     95trap EXIT 
     96rm -rf $LIVE_ROOT 
     97 
  • branches/confman-1.9/conflock.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/confman-1.9/confmanlib.sh.in

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.