Changeset 515 for trunk


Ignore:
Timestamp:
05/12/2011 17:26:56 (13 months ago)
Author:
blee
Message:

implement locking for confexport, fixes #141

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/confexport.in

    r508 r515  
    4040fi 
    4141 
    42 # This potentially changes the behavior for selecting the REPO_URI 
     42# This changes the behavior of some library functions (e.g. URIs, locks) 
    4343CONF_EXPORT="true" 
    4444 
     
    6464    exec 1>/dev/null 
    6565fi 
     66 
     67confexport_lock_system 
    6668 
    6769umask 077 
     
    102104fi 
    103105 
     106confexport_unlock_system "${system_lock}" 
     107 
    104108echo "Export complete." | conf_logger 
    105109 
    106110conf_cleanExit 0 
    107  
  • trunk/confman.conf.in

    r511 r515  
    2121# The system lockfile 
    2222LOCKFILE="@localstaterundir@/confman.lock" 
     23 
     24# The system lockfile for confexport 
     25CONFEXPORT_LOCKFILE="@localstaterundir@/confexport.lock" 
    2326 
    2427# The script for locking 
  • trunk/confmanlib.sh.in

    r513 r515  
    230230                    ;; 
    231231    esac 
     232} 
     233 
     234function confexport_lock_system { 
     235    "${LOCK}" lock $$ "${CONFEXPORT_LOCKFILE}" || die 
     236} 
     237 
     238function confexport_unlock_system { 
     239    "${LOCK}" unlock $$ "${CONFEXPORT_LOCKFILE}" 
     240} 
     241 
     242function confexport_system_is_locked { 
     243    "${LOCK}" haslock $$ "${CONFEXPORT_LOCKFILE}" 
    232244} 
    233245 
     
    11721184 
    11731185    conf_debug "Removing any system or working copy locks..." >&4 
    1174     conf_wcopy_is_locked && conf_unlock_wcopy ORIGINAL 
    1175     conf_system_is_locked && conf_unlock_system ORIGINAL 
     1186    if ${CONF_EXPORT}; then 
     1187        confexport_system_is_locked && confexport_unlock_system 
     1188    else 
     1189        conf_wcopy_is_locked && conf_unlock_wcopy ORIGINAL 
     1190        conf_system_is_locked && conf_unlock_system ORIGINAL 
     1191    fi 
    11761192         
    11771193        # And this clears any locks we may have created on our working copy: 
Note: See TracChangeset for help on using the changeset viewer.