Changeset 90
- Timestamp:
- 04/19/2006 14:01:22 (6 years ago)
- Location:
- confman
- Files:
-
- 2 edited
-
confman (modified) (10 diffs)
-
confmanlib.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confman/confman
r89 r90 80 80 81 81 # And we'll set a trap: 82 trap "c leanexit" SIGINT SIGTERM82 trap "conf_cleanexit" SIGINT SIGTERM 83 83 84 84 … … 118 118 if [ -z $* ] ; then 119 119 for layer in $LAYERS ; do 120 conf_update_module $layer || c leanexit121 done 122 conf_update_module ${REPO_CHECKPTS} || c leanexit120 conf_update_module $layer || conf_cleanexit 121 done 122 conf_update_module ${REPO_CHECKPTS} || conf_cleanexit 123 123 else 124 124 print_usage 1 … … 140 140 echo "Change this file to your log message." > $msg 141 141 ${EDITOR} $msg 142 update || c leanexit142 update || conf_cleanexit 143 143 144 144 echo "Commit operation started" >&2 … … 163 163 # Short name intentional, don't want collision with real install. 164 164 function inst { 165 local file 165 local file livefile 166 166 167 167 if [ -z $* ] ; then … … 172 172 echo "Change this file to your log message." > $msg 173 173 ${EDITOR} $msg 174 update || c leanexit174 update || conf_cleanexit 175 175 176 176 echo "Installation operation started." >&2 177 177 for layer in $LAYERS ; do 178 echo "Layer: $layer" 178 179 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 191 184 done 192 185 echo "Installation operation succeeded." >&2 … … 241 234 if sudo [ -L $file ] ; then 242 235 echo "$MYNAME: Error: $file is a symbolic link!" >&2 243 c leanexit236 conf_cleanexit 244 237 fi 245 238 … … 247 240 echo "$MYNAME: Error: $file already exists in your working" \ 248 241 "copy of $module." 249 c leanexit242 conf_cleanexit 250 243 fi 251 244 … … 256 249 "the ${layer} module." >&2 257 250 echo "Did you mean -f ?" >&2 258 c leanexit251 conf_cleanexit 259 252 fi 260 253 done … … 546 539 else 547 540 echo "Rolling $module back to $checkpoint $clock" >&2 548 conf_rollback $module $checkpoint $clock || c leanexit541 conf_rollback $module $checkpoint $clock || conf_cleanexit 549 542 for layer in $LAYERS ; do 550 543 echo "Rolling on $layer..." 551 conf_rollout $layer || c leanexit544 conf_rollout $layer || conf_cleanexit 552 545 done 553 546 554 547 for file in $SINGULARITIES ; do 555 conf_assemble_sing $file || c leanexit548 conf_assemble_sing $file || conf_cleanexit 556 549 done 557 550 echo "Rollback succeeded." >&2 … … 593 586 } 594 587 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 604 589 605 590 # Dispatch the subcommand. This must happen last and in the global context. -
confman/confmanlib.sh
r78 r90 106 106 function conf_install { 107 107 local module="$1" 108 local file= "$2"108 local file=`abspath $2` 109 109 local moduledir="${WORK_PATH}/$module" 110 110 local livefile=`echo "$file" | sed -E "s:${WORK_PATH}/[^/]+::"` 111 local pathmodule=`echo "$file" | sed -E "s:${WORK_PATH}/([^/]+).*:\1:"` 112 local suffix 113 livefile=`echo "$livefile" | sed -E "s:-${pathmodule}$::"` 114 if [[ $SINGULARITIES =~ $livefile ]] ; then 115 suffix="-${module}" 116 fi 117 livefile="${livefile}${suffix}" 118 111 119 112 120 # See if it even exists … … 319 327 } 320 328 321 322 329 function conf_cleanexit { 330 rm -f /tmp/confman* 331 332 # And in case we got an interrupt during a rollout, we still want the 333 # permissions here to be in a consistent state. 334 chmod 700 ${WORK_PATH} 335 336 # And this clears any locks we may have created on our working copy: 337 svn cleanup ${WORK_PATH} 338 339 if [ -z $1 ] ; then 340 exit 1 341 else 342 exit $1 343 fi 344 345 } 346
Note: See TracChangeset
for help on using the changeset viewer.
