Changeset 459 for branches


Ignore:
Timestamp:
10/06/2009 16:40:31 (3 years ago)
Author:
blee
Message:

Merge from trunk new temporary file architecture. Plugs multiple leaks.

Fixes #66

Location:
branches/confman-1.9
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

    • Property svn:mergeinfo changed
      /trunkmerged: 437
  • branches/confman-1.9/confadmin.in

    r339 r459  
    6666        case $opt in 
    6767                d) DEBUG="true" ;; 
    68         h) shift ; print_help "$@" ; exit 0 ;; 
     68        h) shift ; print_help "$@" ; conf_cleanExit 0 ;; 
    6969                *) print_usage 1 ;; 
    7070        esac 
     
    7676 
    7777case $subcommand in 
    78     help )                          print_help "$@" ; exit 0 ;; 
     78    help )                          print_help "$@" ; conf_cleanExit 0 ;; 
    7979    setup )                         repo_setup ;; 
    8080    * )                             print_usage 1 ;; 
    8181esac  
    8282 
    83 exit 0 
     83conf_cleanExit 0 
    8484 
    8585# vim:ts=4 
  • branches/confman-1.9/confadmindoc.sh

    r448 r459  
    4444EOF 
    4545 
    46 # Clear the cleanup trap  
    47 trap EXIT 
    48 exit $1 
     46conf_cleanExit $1 
    4947} 
    5048 
  • branches/confman-1.9/confaudit.in

    r429 r459  
    5353done 
    5454 
    55 trap "conf_cleanExit" EXIT 
    5655# If we're in debug mode, we should log stderr messages to the logger 
    5756# as well. Otherwise, we send them to the bit bucket. 
     
    131130conf_unlock_system 
    132131 
    133 trap EXIT 
    134132rm -rf $tmproot 
    135133 
     134conf_cleanExit 0 
     135 
  • branches/confman-1.9/confexport.in

    r429 r459  
    104104echo "Export complete." | conf_logger 
    105105 
     106conf_cleanExit 0 
     107 
  • branches/confman-1.9/confman.in

    r455 r459  
    976976        case $opt in 
    977977                d) DEBUG="true" ; shift ;; 
    978         h) shift ; print_help "$@" ; exit 0 ;; 
    979         v) print_version ; exit 0 ;; 
     978        h) shift ; print_help "$@" ; conf_cleanExit 0 ;; 
     979        v) print_version ; conf_cleanExit 0 ;; 
    980980                *) print_usage 1 ;; 
    981981        esac 
     
    985985subcommand=$1 
    986986shift 
    987 trap "conf_cleanExit" EXIT 
    988987trap "conf_interrupt_trap" HUP INT QUIT TERM 
    989988case $subcommand in 
    990     help )                          print_help "$@" ; trap EXIT; exit 0 ;; 
    991     version )                       print_version; trap EXIT; exit 0;; 
     989    help )                          print_help "$@" ; conf_cleanExit 0 ;; 
     990    version )                       print_version; conf_cleanExit 0;; 
    992991    setup|se* )                     setup "$@" ;; 
    993992    status )                        status "$@" ;; 
     
    10261025esac  
    10271026 
    1028 trap EXIT 
    1029 exit 
     1027conf_cleanExit 0 
    10301028 
    10311029# vim:ts=4:ft=sh 
  • branches/confman-1.9/confmancommon.sh.in

    r414 r459  
    3333UCONF="${HOME}/.confmanrc" 
    3434MYNAME=`basename $0` 
    35 TMPFILES="" 
    3635if [ `id -u` != "0" ]; then 
    3736    SUDO="@SUDO@" 
     
    104103fetch_cmd="@WGET@ -q -O" 
    105104 
     105# Create a base temporary directory for this process 
     106export TMPDIR=`$mktemp_dir` 
     107 
    106108# Get the user config 
    107109if [ -f "$UCONF" ] ; then 
     
    133135 
    134136# And we'll set a trap: 
    135 trap "conf_cleanExit" SIGINT SIGTERM SIGHUP 
     137trap "conf_cleanExit" SIGINT SIGTERM SIGHUP EXIT 
    136138 
  • branches/confman-1.9/confmandoc.sh

    r455 r459  
    7676EOF 
    7777 
    78 # Clear the cleanup trap  
    79 trap EXIT 
    80 exit $1 
     78conf_cleanExit $1 
    8179} 
    8280 
  • branches/confman-1.9/confmanlib.sh.in

    r455 r459  
    10291029 
    10301030        conf_debug "Removing leftover temp files..." >&4 
    1031     for file in $TMPFILES ; do rm -rf $file ; done 
     1031    rm -rf $TMPDIR 
    10321032 
    10331033    conf_debug "Removing any system or working copy locks..." >&4 
     
    10871087function conf_tmp_file { 
    10881088    local file=$(${mktemp_file}) || return 1 
    1089     TMPFILES="${TMPFILES} ${file}" 
    10901089    echo $file 
     1090    return 0 
    10911091} 
    10921092 
    10931093function conf_tmp_dir { 
    10941094    local dir=$(${mktemp_dir}) || return 1 
    1095     TMPFILES="${TMPFILES} ${dir}" 
    10961095    echo $dir 
     1096    return 0 
    10971097} 
    10981098 
  • branches/confman-1.9/confsync.in

    r429 r459  
    5656done 
    5757 
    58 trap "conf_cleanExit" EXIT 
    5958# If we're in debug mode, we should log stderr messages to the logger 
    6059# as well. Otherwise, we send them to the bit bucket. 
     
    146145conf_unlock_system 
    147146 
    148 trap EXIT 
    149147rm -rf $tmpdir 
    150148 
     149conf_cleanExit 0 
     150 
Note: See TracChangeset for help on using the changeset viewer.