Changeset 520
- Timestamp:
- 06/17/2011 16:25:47 (11 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
abspath.in (modified) (1 diff)
-
confman.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/abspath.in
r329 r520 38 38 dir=`cd $file >/dev/null; echo \$PWD` 39 39 echo "$dir" 40 else 40 return 0 41 elif [ -d $(dirname $file) ]; then 41 42 dir=`cd $(dirname $file) >/dev/null ; echo \$PWD` 42 43 echo "$dir/$(basename "$file")" 44 return 0 45 else 46 return 1 43 47 fi 44 48 } -
trunk/confman.in
r518 r520 388 388 # If we can't enter the parent directory, this will help us 389 389 # get the info we need. 390 if ! $SUDO [ -e $1 ]; then 391 echo "No such file or directory: $1" >&2 392 return 1 393 else 394 file=`$SUDO $ABSPATH $1` 390 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" 395 400 fi 396 401 fi … … 487 492 return 488 493 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 489 526 # Prompt for file owner 490 527 echo "Who should be the file's owner? [ $owner ]"
Note: See TracChangeset
for help on using the changeset viewer.
