diff options
author | obrien <obrien@FreeBSD.org> | 2000-11-26 21:26:20 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-11-26 21:26:20 +0000 |
commit | 150ca1a16110713598ba58dc8851c364c1acc188 (patch) | |
tree | 770c3a29505e36cc856a542727c837a44ba6d339 /contrib/file/mkinstalldirs | |
parent | 73a570e26c8be2eb28ff624691d53679235db6d7 (diff) | |
download | FreeBSD-src-150ca1a16110713598ba58dc8851c364c1acc188.zip FreeBSD-src-150ca1a16110713598ba58dc8851c364c1acc188.tar.gz |
Virgin import of Christos Zoulas FILE 3.33.
Diffstat (limited to 'contrib/file/mkinstalldirs')
-rw-r--r-- | contrib/file/mkinstalldirs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/contrib/file/mkinstalldirs b/contrib/file/mkinstalldirs index e69de29..922a27e 100644 --- a/contrib/file/mkinstalldirs +++ b/contrib/file/mkinstalldirs @@ -0,0 +1,39 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.2 2000/11/13 00:30:49 christos 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 + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + |