annotate mkinstalldirs @ 75:6419cd5286ae

[gaim-migrate @ 85] Translated buddytrans from perl to C. To be swallowed by gaim later. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 28 Mar 2000 21:21:33 +0000
parents 494816c30ca7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 #! /bin/sh
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 # mkinstalldirs --- make directory hierarchy
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 # Created: 1993-05-16
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 # Public domain
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 # $Id: mkinstalldirs 14 2000-03-23 03:23:41Z robflynn $
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 errstatus=0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 for file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 pathcomp=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 for d
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 pathcomp="$pathcomp$d"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 case "$pathcomp" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 -* ) pathcomp=./$pathcomp ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 if test ! -d "$pathcomp"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 echo "mkdir $pathcomp" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 mkdir "$pathcomp" || lasterr=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 if test ! -d "$pathcomp"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 errstatus=$lasterr
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 pathcomp="$pathcomp/"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 exit $errstatus
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 # mkinstalldirs ends here