annotate doc/lispref/mkinstalldirs @ 93769:36fb7e6fada5

*** empty log message ***
author Jason Rumney <jasonr@gnu.org>
date Sun, 06 Apr 2008 15:14:22 +0000
parents 2e38ef4443ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84088
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1 #! /bin/sh
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2 # mkinstalldirs --- make directory hierarchy
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
4 # Created: 1993-05-16
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
5 # Public domain
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
6
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
7 errstatus=0
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
8
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
9 for file
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
10 do
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
11 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
12 shift
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
13
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
14 pathcomp=
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
15 for d
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
16 do
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
17 pathcomp="$pathcomp$d"
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
18 case "$pathcomp" in
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
19 -* ) pathcomp=./$pathcomp ;;
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
20 esac
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
21
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
22 if test ! -d "$pathcomp"; then
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
23 echo "mkdir $pathcomp" 1>&2
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
24
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
25 mkdir "$pathcomp" || lasterr=$?
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
26
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
27 if test ! -d "$pathcomp"; then
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
28 errstatus=$lasterr
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
29 fi
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
30 fi
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
31
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
32 pathcomp="$pathcomp/"
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
33 done
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
34 done
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
35
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
36 exit $errstatus
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
37
2e38ef4443ea Move here from ../../lispref
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
38 # mkinstalldirs ends here