diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2007-05-03 12:33:20 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2007-05-03 12:33:20 +0000 |
| commit | d84e2832f7534558f66ea117073c8ee5320fcbd1 (patch) | |
| tree | 85fe75f20f45241e81de950cd3c76c50ea11be9c /mkinstalldirs | |
| parent | 40be03495dd074c2ea6cc39ba6b7c6e39cf72815 (diff) | |
Second aproach at solving the 'install -d' issue. I added a public domain script that supposedly solves the issue on every box. I also looke at 'install-sh', but found a bazillion of versions, doing so much more than we actually need. But I am open to sugestions, and happy to reverse my changes if something better comes along.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5799 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'mkinstalldirs')
| -rwxr-xr-x | mkinstalldirs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 000000000..0fdf6bf16 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,48 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ + +errstatus=0 + +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 + + if test ! -d "$pathcomp"; then + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + lasterr="" + + chmod 755 "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here + |
