Changeset 39 for confman/confman


Ignore:
Timestamp:
03/29/2006 13:55:13 (6 years ago)
Author:
ccowart
Message:

Fixed up the handling of paths for making new directories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/confman

    r38 r39  
    537537function newdir { 
    538538        local dir=$1 
    539         local response  
     539        local response module realpath 
    540540        local mode=$DEFAULT_MODE 
    541541        local owner=$DEFAULT_OWNER 
    542542        local group=$DEFAULT_GROUP 
    543543        local comment="dir" 
    544         # Ugh. This doesn't work when the function is called from import... 
    545         # It assumes we're working in the working copy... 
    546544        local workdir=`abspath .` 
    547545        if [ -z $1 ] ; then 
     
    550548 
    551549        # Find the "real" directory's path 
    552         dir="${workdir}/${dir}" 
    553         echo $dir 
    554         local module=`echo ${workdir#$WORK_PATH/} | sed -E 's:/([^/]+)/.*:\1:'` 
    555         echo $module 
    556         local realpath=${dir#${WORK_PATH}/${module}} 
    557         echo $realpath 
     550        if [[ ! $dir =~ "^\/" ]] ; then 
     551                dir="${workdir}/${dir}" 
     552        fi 
     553        module=`echo ${dir#$WORK_PATH} | sed -E 's:/([^/]+)/.*:\1:'` 
     554        realpath=${dir#${WORK_PATH}/${module}} 
    558555 
    559556        if [ -d $realpath ] ; then 
Note: See TracChangeset for help on using the changeset viewer.