/[LeafOK_CVS]/pvpgn-1.7.4/src/autoconf/mkdir-p
ViewVC logotype

Contents of /pvpgn-1.7.4/src/autoconf/mkdir-p

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Tue Jun 6 03:41:37 2006 UTC (19 years, 9 months ago) by sysadm
Branch: GNU, MAIN
CVS Tags: arelease, HEAD
Changes since 1.1: +0 -0 lines
no message

1 #! /bin/sh
2 # $XConsortium: mkdirhier.sh,v 1.7 94/03/24 15:46:34 gildea Exp $
3 # Courtesy of Paul Eggert
4
5 #
6 # Modified by QingLong <qinglong@Yggdrasil.com> for portability. 24-02-97.
7 #
8
9
10 newline='
11 '
12 IFS=$newline
13
14 #
15 # WARNING! Some ancient shells do not understand `:=' and `:-' expansion.
16 # Use just `=' instead of `:=' if you have lame one.
17 #: ${MKDIR:=mkdir} ${TR:=tr}
18 #
19
20 if test -z "${MKDIR-}" ;
21 then
22 MKDIR=mkdir
23 fi
24
25 if test -z "${TR-}" ;
26 then
27 TR=tr
28 fi
29
30
31 case ${1--} in
32 -*) echo >&2 "mkdir-p: usage: mkdir-p directory ..."
33 exit 1
34 esac
35
36 status=""
37
38 for directory
39 do
40 case $directory in
41 '')
42 echo >&2 "mkdir-p: empty directory name"
43 status="1"
44 continue
45 ;;
46 *"$newline"*)
47 echo >&2 "mkdir-p: directory name contains a newline: \`\`$directory''"
48 status="1"
49 continue
50 ;;
51 ///*) prefix="/" # See POSIX 2.3 "path".
52 ;;
53 //*) prefix="//"
54 ;;
55 /*) prefix="/"
56 ;;
57 -*) prefix="./"
58 ;;
59 *) prefix=""
60 esac
61 #
62 IFS=/
63 set x $directory
64 #
65 case $2 in
66 */*)
67 # IFS parsing is broken
68 IFS=' '
69 set x `echo $directory | ${TR} / ' '`
70 ;;
71 esac
72 #
73 IFS=$newline
74 shift
75 #
76 for filename
77 do
78 path="$prefix$filename"
79 prefix="$path/"
80 shift
81 #
82 test -d "$path" || \
83 {
84 paths=$path
85 for filename
86 do
87 if test "$filename" != "." ;
88 then
89 path="$path/$filename"
90 paths="$paths$newline$path"
91 fi
92 done
93 #
94 ${MKDIR} $paths || status=$?
95 #
96 break
97 }
98 done
99 done
100
101 exit $status

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1