Ignore:
Timestamp:
11/11/2009 14:27:08 (3 years ago)
Author:
ccowart
Message:

Merging rename and sed cleanups from trunk.

Resolves #97, #98

Location:
branches/confman-1.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/confman-1.9

  • branches/confman-1.9/confman.in

    r484 r487  
    787787    local oldmod=$1 
    788788    local newmod=$2 
    789     local wcopy_lock 
    790     if [ -z $newmod ] ; then 
     789    local dir 
     790    local wcopy_lock 
     791    if [ -z "$oldmod" -o -z "$newmod" ]; then 
    791792        print_usage 1 
    792793    fi 
    793     if [ ! -d "${WORK_PATH}/${oldmod}" ] ; then 
    794         echo "${MYNAME}: Error: ${WORK_PATH}/${oldmod} doesn't exist" >&4 
    795         conf_cleanExit 
    796     fi 
    797     if [ -e "${WORK_PATH}/${newmod}" ] ; then 
    798         echo "${MYNAME}: Error: ${WORK_PATH}/${newmod}: file exists" >&4 
    799         conf_cleanExit 
    800     fi 
    801     wcopy_lock=$(conf_lock_wcopy) 
    802     conf_rename $oldmod $newmod 
     794    wcopy_lock=$(conf_lock_wcopy) 
     795    conf_update_tree || exit 1 
     796    for dir in ${WORK_PATH}/{,${REPO_CHECKPTS}/}$oldmod; do 
     797        if ! [ -d "$dir" ]; then 
     798            echo "No such directory: $dir" >&4 
     799            exit 1 
     800        fi 
     801    done 
     802    for dir in ${WORK_PATH}/{,${REPO_CHECKPTS}/}$newmod; do 
     803        if [ -e "$dir" ]; then 
     804            echo "Directory already exists: $dir" >&4 
     805            exit 1 
     806        fi 
     807    done 
     808    conf_rename $oldmod $newmod || exit 1 
    803809    conf_unlock_wcopy $wcopy_lock 
    804810} 
Note: See TracChangeset for help on using the changeset viewer.