Ignore:
Timestamp:
Mar 9, 2007 6:17:34 AM (17 years ago)
Author:
nkissebe
Message:

update file in tclconfig that was missed in last update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tcl/tclconfig/mkinstalldirs

    r204 r620  
    11#! /bin/sh
    22# mkinstalldirs --- make directory hierarchy
    3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
     3
     4scriptversion=2003-11-08.23
     5
     6# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
    47# Created: 1993-05-16
    5 # Public domain
    6 
    7 # $Id: mkinstalldirs,v 1.1.1.1 1999/08/04 23:03:40 wart Exp $
     8# Public domain.
     9#
     10# This file is maintained in Automake, please report
     11# bugs to <bug-automake@gnu.org> or send patches to
     12# <automake-patches@gnu.org>.
    813
    914errstatus=0
     15dirmode=""
     16
     17usage="\
     18Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
     19
     20Create each directory DIR (with mode MODE, if specified), including all
     21leading file name components.
     22
     23Report bugs to <bug-automake@gnu.org>."
     24
     25# process command line arguments
     26while test $# -gt 0 ; do
     27  case $1 in
     28    -h | --help | --h*)         # -h for help
     29      echo "$usage"
     30      exit 0
     31      ;;
     32    -m)                         # -m PERM arg
     33      shift
     34      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
     35      dirmode=$1
     36      shift
     37      ;;
     38    --version)
     39      echo "$0 $scriptversion"
     40      exit 0
     41      ;;
     42    --)                         # stop option processing
     43      shift
     44      break
     45      ;;
     46    -*)                         # unknown option
     47      echo "$usage" 1>&2
     48      exit 1
     49      ;;
     50    *)                          # first non-opt arg
     51      break
     52      ;;
     53  esac
     54done
    1055
    1156for file
    1257do
    13    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    14    shift
     58  if test -d "$file"; then
     59    shift
     60  else
     61    break
     62  fi
     63done
    1564
    16    pathcomp=
    17    for d
    18    do
    19      pathcomp="$pathcomp$d"
    20      case "$pathcomp" in
    21        -* ) pathcomp=./$pathcomp ;;
    22      esac
     65case $# in
     66  0) exit 0 ;;
     67esac
    2368
    24      if test ! -d "$pathcomp"; then
    25         echo "mkdir $pathcomp"
     69case $dirmode in
     70  '')
     71    if mkdir -p -- . 2>/dev/null; then
     72      echo "mkdir -p -- $*"
     73      exec mkdir -p -- "$@"
     74    else
     75      # On NextStep and OpenStep, the `mkdir' command does not
     76      # recognize any option.  It will interpret all options as
     77      # directories to create, and then abort because `.' already
     78      # exists.
     79      test -d ./-p && rmdir ./-p
     80      test -d ./-- && rmdir ./--
     81    fi
     82    ;;
     83  *)
     84    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
     85      echo "mkdir -m $dirmode -p -- $*"
     86      exec mkdir -m "$dirmode" -p -- "$@"
     87    else
     88      # Clean up after NextStep and OpenStep mkdir.
     89      for d in ./-m ./-p ./-- "./$dirmode";
     90      do
     91        test -d $d && rmdir $d
     92      done
     93    fi
     94    ;;
     95esac
    2696
    27         mkdir "$pathcomp" || lasterr=$?
     97for file
     98do
     99  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
     100  shift
    28101
    29         if test ! -d "$pathcomp"; then
    30           errstatus=$lasterr
    31         fi
    32      fi
     102  pathcomp=
     103  for d
     104  do
     105    pathcomp="$pathcomp$d"
     106    case $pathcomp in
     107      -*) pathcomp=./$pathcomp ;;
     108    esac
    33109
    34      pathcomp="$pathcomp/"
    35    done
     110    if test ! -d "$pathcomp"; then
     111      echo "mkdir $pathcomp"
     112
     113      mkdir "$pathcomp" || lasterr=$?
     114
     115      if test ! -d "$pathcomp"; then
     116        errstatus=$lasterr
     117      else
     118        if test ! -z "$dirmode"; then
     119          echo "chmod $dirmode $pathcomp"
     120          lasterr=""
     121          chmod "$dirmode" "$pathcomp" || lasterr=$?
     122
     123          if test ! -z "$lasterr"; then
     124            errstatus=$lasterr
     125          fi
     126        fi
     127      fi
     128    fi
     129
     130    pathcomp="$pathcomp/"
     131  done
    36132done
    37133
    38134exit $errstatus
    39135
    40 # mkinstalldirs ends here
     136# Local Variables:
     137# mode: shell-script
     138# sh-indentation: 2
     139# eval: (add-hook 'write-file-hooks 'time-stamp)
     140# time-stamp-start: "scriptversion="
     141# time-stamp-format: "%:y-%02m-%02d.%02H"
     142# time-stamp-end: "$"
     143# End:
Note: See TracChangeset for help on using the changeset viewer.