summaryrefslogtreecommitdiff
path: root/fastjar
diff options
context:
space:
mode:
authorneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-30 01:37:07 +0000
committerneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-30 01:37:07 +0000
commit9e25ae93e2f3875029d0e07b58917e67f76c52ed (patch)
tree509cff6eb36ef7d2662b794f826d2e86fed9620e /fastjar
parente0744b80d150937e7b8e659e5486493d37874b03 (diff)
downloadgcc-9e25ae93e2f3875029d0e07b58917e67f76c52ed.tar.gz
* mkinstalldirs: Import autoconf 2.57 / automake 1.7 version.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fastjar')
-rw-r--r--fastjar/ChangeLog4
-rwxr-xr-xfastjar/mkinstalldirs111
2 files changed, 95 insertions, 20 deletions
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index edea582c96e..f1db5e672d1 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-29 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version.
+
2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* README: Note that FastJar is not part of GCC.
diff --git a/fastjar/mkinstalldirs b/fastjar/mkinstalldirs
index 4f58503ea4e..d2d5f21b611 100755
--- a/fastjar/mkinstalldirs
+++ b/fastjar/mkinstalldirs
@@ -4,37 +4,108 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
-
errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage" 1>&2
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
+ mkdir "$pathcomp" || lasterr=$?
- mkdir "$pathcomp" || lasterr=$?
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
# mkinstalldirs ends here