Changeset 521


Ignore:
Timestamp:
08/02/2011 15:04:23 (10 months ago)
Author:
joshu
Message:

Reverting changes made for import failing on nonexistent directories; see #132

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abspath.in

    r520 r521  
    3838    dir=`cd $file >/dev/null; echo \$PWD` 
    3939    echo "$dir" 
    40     return 0 
    41   elif [ -d $(dirname $file) ]; then 
     40  else 
    4241    dir=`cd $(dirname $file) >/dev/null ; echo \$PWD` 
    4342    echo "$dir/$(basename "$file")" 
    44     return 0 
    45   else 
    46     return 1 
    4743  fi 
    4844} 
  • trunk/confman.in

    r520 r521  
    389389        # get the info we need. 
    390390        file=`$SUDO $ABSPATH $1` 
    391         if [ $? -eq 1 ]; then 
    392             filename="$(basename $1)" 
    393             real_path="$(dirname $1)" 
    394             imaginary_path="" 
    395             while ! [ -d $real_path ]; do 
    396                 imaginary_path="/${real_path##*/}$imaginary_path" 
    397                 real_path="${real_path%/*}" 
    398             done 
    399             file="$($SUDO $ABSPATH $real_path)$imaginary_path/$filename" 
    400         fi 
    401391    fi 
    402392    shift 
     
    492482        return 
    493483    else 
    494         # If some of the directories containing the file don't exist, we should 
    495         # prompt for the creation of those directories ... 
    496         if [ -z $imaginary_path ]; then 
    497             for directory in ${imaginary_path//\// }; do 
    498                 d_owner=$owner 
    499                 d_group=$group 
    500                 d_mode=$mode 
    501                 echo "${real_path}/${directory} does not exist; creating it." 
    502                 # Prompt for directory owner 
    503                 echo "Who should be the directory's owner? [ $d_owner ]" 
    504                 read response 
    505                 if [ ! -z $response ] ; then 
    506                     d_owner=$response 
    507                 fi 
    508          
    509                 # And directory's group 
    510                 echo "Who should be the directory's group? [ $d_group ]" 
    511                 read response 
    512                 if [ ! -z $response ] ; then 
    513                     d_group=$response 
    514                 fi 
    515          
    516                 # now, the permissions 
    517                 echo "What should the directory's permissions be? [ $d_mode ]" 
    518                 read response 
    519                 if [ ! -z $response ] ; then 
    520                     d_mode=$response 
    521                 fi 
    522                 real_path="$real_path/$directory" 
    523                 conf_mkdir $real_path $d_owner $d_group $d_mode 
    524             done 
    525         fi 
    526484        # Prompt for file owner 
    527485        echo "Who should be the file's owner? [ $owner ]" 
Note: See TracChangeset for help on using the changeset viewer.