Changeset 90 for confman/confman


Ignore:
Timestamp:
04/19/2006 14:01:22 (6 years ago)
Author:
ccowart
Message:

Singularity support for the inst function. See Bug #4204

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r89 r90  
    8080 
    8181# And we'll set a trap: 
    82 trap "cleanexit" SIGINT SIGTERM 
     82trap "conf_cleanexit" SIGINT SIGTERM 
    8383 
    8484 
     
    118118        if [ -z $* ] ; then 
    119119                for layer in $LAYERS ; do 
    120                         conf_update_module $layer || cleanexit 
    121                 done 
    122                 conf_update_module ${REPO_CHECKPTS} || cleanexit 
     120                        conf_update_module $layer || conf_cleanexit 
     121                done 
     122                conf_update_module ${REPO_CHECKPTS} || conf_cleanexit 
    123123        else 
    124124                print_usage 1 
     
    140140                echo "Change this file to your log message." > $msg 
    141141                ${EDITOR} $msg 
    142                 update || cleanexit 
     142                update || conf_cleanexit 
    143143 
    144144                echo "Commit operation started" >&2 
     
    163163# Short name intentional, don't want collision with real install. 
    164164function inst { 
    165         local file 
     165        local file livefile 
    166166 
    167167        if [ -z $* ] ; then 
     
    172172                echo "Change this file to your log message." > $msg 
    173173                ${EDITOR} $msg 
    174                 update || cleanexit 
     174                update || conf_cleanexit 
    175175 
    176176                echo "Installation operation started." >&2 
    177177                for layer in $LAYERS ; do 
     178                        echo "Layer: $layer" 
    178179                        conf_commit $layer $msg || return $? 
    179                 done 
    180  
    181                 for file in $* ; do 
    182                         file=`abspath $file` 
    183  
    184                         for layer in $LAYERS ; do 
    185                                 conf_install $layer $file || return $? 
    186                         done 
    187                          
    188                         if [[ "$SINGULARITIES" =~ "$file" ]] ; then 
    189                                 conf_assemble_file $file || return $? 
    190                         fi 
     180                        conf_install $layer $* 
     181                done 
     182                for file in $SINGULARITIES ; do 
     183                        conf_assemble_sing $file || conf_cleanexit 
    191184                done 
    192185                echo "Installation operation succeeded." >&2 
     
    241234        if sudo [ -L $file ] ; then 
    242235                echo "$MYNAME: Error: $file is a symbolic link!" >&2 
    243                 cleanexit 
     236                conf_cleanexit 
    244237        fi 
    245238 
     
    247240                echo "$MYNAME: Error: $file already exists in your working" \ 
    248241                     "copy of $module." 
    249                 cleanexit 
     242                conf_cleanexit 
    250243        fi 
    251244 
     
    256249                                     "the ${layer} module." >&2 
    257250                                echo "Did you mean -f ?" >&2 
    258                                 cleanexit 
     251                                conf_cleanexit 
    259252                        fi 
    260253                done 
     
    546539        else 
    547540                echo "Rolling $module back to $checkpoint $clock" >&2 
    548                 conf_rollback $module $checkpoint $clock || cleanexit 
     541                conf_rollback $module $checkpoint $clock || conf_cleanexit 
    549542                for layer in $LAYERS ; do 
    550543                        echo "Rolling on $layer..." 
    551                         conf_rollout $layer || cleanexit 
     544                        conf_rollout $layer || conf_cleanexit 
    552545                done 
    553546 
    554547                for file in $SINGULARITIES ; do 
    555                         conf_assemble_sing $file || cleanexit 
     548                        conf_assemble_sing $file || conf_cleanexit 
    556549                done 
    557550                echo "Rollback succeeded." >&2 
     
    593586} 
    594587 
    595 function cleanexit { 
    596   rm -f /tmp/confman* 
    597  
    598   # And in case we got an interrupt during a rollout, we still want the 
    599   # permissions here to be in a consistent state. 
    600   chmod 700 ${WORK_PATH} 
    601  
    602   exit 1 
    603 } 
     588 
    604589 
    605590# Dispatch the subcommand. This must happen last and in the global context. 
Note: See TracChangeset for help on using the changeset viewer.