OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [readline/] [support/] [mkinstalldirs] - Diff between revs 24 and 33

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
#! /bin/sh
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman 
# Author: Noah Friedman 
# Created: 1993-05-16
# Created: 1993-05-16
# Public domain
# Public domain
errstatus=0
errstatus=0
dirmode=""
dirmode=""
usage="\
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
# process command line arguments
while test $# -gt 0 ; do
while test $# -gt 0 ; do
  case $1 in
  case $1 in
    -h | --help | --h*)         # -h for help
    -h | --help | --h*)         # -h for help
      echo "$usage" 1>&2
      echo "$usage" 1>&2
      exit 0
      exit 0
      ;;
      ;;
    -m)                         # -m PERM arg
    -m)                         # -m PERM arg
      shift
      shift
      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
      dirmode=$1
      dirmode=$1
      shift
      shift
      ;;
      ;;
    --)                         # stop option processing
    --)                         # stop option processing
      shift
      shift
      break
      break
      ;;
      ;;
    -*)                         # unknown option
    -*)                         # unknown option
      echo "$usage" 1>&2
      echo "$usage" 1>&2
      exit 1
      exit 1
      ;;
      ;;
    *)                          # first non-opt arg
    *)                          # first non-opt arg
      break
      break
      ;;
      ;;
  esac
  esac
done
done
for file
for file
do
do
  if test -d "$file"; then
  if test -d "$file"; then
    shift
    shift
  else
  else
    break
    break
  fi
  fi
done
done
case $# in
case $# in
  0) exit 0 ;;
  0) exit 0 ;;
esac
esac
case $dirmode in
case $dirmode in
  '')
  '')
    if mkdir -p -- . 2>/dev/null; then
    if mkdir -p -- . 2>/dev/null; then
      echo "mkdir -p -- $*"
      echo "mkdir -p -- $*"
      exec mkdir -p -- "$@"
      exec mkdir -p -- "$@"
    fi
    fi
    ;;
    ;;
  *)
  *)
    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
      echo "mkdir -m $dirmode -p -- $*"
      echo "mkdir -m $dirmode -p -- $*"
      exec mkdir -m "$dirmode" -p -- "$@"
      exec mkdir -m "$dirmode" -p -- "$@"
    fi
    fi
    ;;
    ;;
esac
esac
for file
for file
do
do
  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
  shift
  shift
  pathcomp=
  pathcomp=
  for d
  for d
  do
  do
    pathcomp="$pathcomp$d"
    pathcomp="$pathcomp$d"
    case $pathcomp in
    case $pathcomp in
      -*) pathcomp=./$pathcomp ;;
      -*) pathcomp=./$pathcomp ;;
    esac
    esac
    if test ! -d "$pathcomp"; then
    if test ! -d "$pathcomp"; then
      echo "mkdir $pathcomp"
      echo "mkdir $pathcomp"
      mkdir "$pathcomp" || lasterr=$?
      mkdir "$pathcomp" || lasterr=$?
      if test ! -d "$pathcomp"; then
      if test ! -d "$pathcomp"; then
        errstatus=$lasterr
        errstatus=$lasterr
      else
      else
        if test ! -z "$dirmode"; then
        if test ! -z "$dirmode"; then
          echo "chmod $dirmode $pathcomp"
          echo "chmod $dirmode $pathcomp"
          lasterr=""
          lasterr=""
          chmod "$dirmode" "$pathcomp" || lasterr=$?
          chmod "$dirmode" "$pathcomp" || lasterr=$?
          if test ! -z "$lasterr"; then
          if test ! -z "$lasterr"; then
            errstatus=$lasterr
            errstatus=$lasterr
          fi
          fi
        fi
        fi
      fi
      fi
    fi
    fi
    pathcomp="$pathcomp/"
    pathcomp="$pathcomp/"
  done
  done
done
done
exit $errstatus
exit $errstatus
# Local Variables:
# Local Variables:
# mode: shell-script
# mode: shell-script
# sh-indentation: 2
# sh-indentation: 2
# End:
# End:
# mkinstalldirs ends here
# mkinstalldirs ends here
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.