diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2000-11-15 20:19:18 +0000 |
---|---|---|
committer | <> | 2013-04-02 19:12:58 +0000 |
commit | 5439ab7459283bf61a0256c3a20df164c780ef6c (patch) | |
tree | b44434fc37619db54e956a868b9d99972357d0d4 /mkinstalldirs | |
download | bc-tarball-5439ab7459283bf61a0256c3a20df164c780ef6c.tar.gz |
Imported from /home/lorry/working-area/delta_bc-tarball/bc-1.06.tar.gz.bc-1.06
Diffstat (limited to 'mkinstalldirs')
-rwxr-xr-x | mkinstalldirs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..cc8783e --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,36 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Last modified: 1994-03-25 +# Public domain + +errstatus=0 + +for file in ${1+"$@"} ; do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d in ${1+"$@"} ; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here |