Changeset 91


Ignore:
Timestamp:
04/19/2006 15:49:56 (6 years ago)
Author:
ccowart
Message:

Debugging and some file descriptor corrections.

Location:
confman
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r90 r91  
    2222# we re-spawn confman inside a pipe. 
    2323if (true >&5) 2>/dev/null ; then 
    24         exec 2>&5 
     24        exec 4>&2 2>&5 >&3- 
    2525else 
    2626        exec 3>&1 
     
    4242fi 
    4343 
     44# Set debugging: 
     45if [ -z $DEBUG ] ; then 
     46        DEBUG="false" 
     47fi 
     48 
    4449# Now, we source the library 
    4550if [ -f $REPO_LIBRARY ] ; then 
     
    8792function setup { 
    8893        local response 
     94        $DEBUG && echo "Running setup" >&4 
    8995        if [ ! -z $* ] ; then 
    9096                print_usage 1 
     
    97103                        setup 
    98104                else 
    99                         echo "Setup failed." >&2 
     105                        echo "Setup failed." >&4 
    100106                        exit 1 
    101107                fi 
     
    176182                echo "Installation operation started." >&2 
    177183                for layer in $LAYERS ; do 
    178                         echo "Layer: $layer" 
     184                        $DEBUG && echo "Layer: $layer" >&4 
    179185                        conf_commit $layer $msg || return $? 
    180186                        conf_install $layer $* 
     
    233239        # Error out when trying to import a symbolic link. 
    234240        if sudo [ -L $file ] ; then 
    235                 echo "$MYNAME: Error: $file is a symbolic link!" >&2 
     241                echo "$file is a symbolic link!" >&4 
    236242                conf_cleanexit 
    237243        fi 
    238244 
    239245        if [ -f ${WORK_PATH}/${module}${file}${suffix} ] ; then 
    240                 echo "$MYNAME: Error: $file already exists in your working" \ 
    241                      "copy of $module." 
     246                echo "$file already exists in your working copy of $module." >&4 
    242247                conf_cleanexit 
    243248        fi 
     
    246251                for layer in $LAYERS ; do 
    247252                        if [ -f ${WORK_PATH}/${layer}${file}${suffix} ] ; then 
    248                                 echo "$MYNAME: Error: $file already exists in" \ 
    249                                      "the ${layer} module." >&2 
    250                                 echo "Did you mean -f ?" >&2 
     253                                echo "$file already exists in the ${layer}" \ 
     254                                     "module." >&4 
     255                                echo "Did you mean -f ?" >&4 
    251256                                conf_cleanexit 
    252257                        fi 
     
    507512                ls $chkdir 
    508513        else 
    509                 echo "$MYNAME: There are no checkpoints for ${module}." 
     514                echo "There are no checkpoints for ${module}." 
    510515        fi 
    511516} 
     
    586591} 
    587592 
     593# Dubug mode? 
     594while getopts "d" opt ; do 
     595        case $opt in 
     596                d) 
     597                DEBUG="true" 
     598                shift 
     599                ;; 
     600                *) 
     601                print_help 1 
     602                ;; 
     603        esac 
     604done 
    588605 
    589606 
  • confman/confman.conf

    r74 r91  
    3939DEFAULT_COMMENT="#" 
    4040 
     41# Enable or disable debugging 
     42DEBUG="false" 
     43 
    4144# A prefix to the live filesystem image. This should be unset if you don't 
    4245# want to use a prefix. Useful for testing confman, by having files installed 
  • confman/confmanlib.sh

    r90 r91  
    328328 
    329329function conf_cleanexit { 
     330  echo "Abort, Abort! Patience is a virtue." >&2 
    330331  rm -f /tmp/confman* 
    331332 
     
    336337  # And this clears any locks we may have created on our working copy: 
    337338  svn cleanup ${WORK_PATH} 
     339  echo "All clean. Terminating." >&2 
    338340 
    339341  if [ -z $1 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.