~dannf/ubuntu/saucy/screen/lp1213278-from-debian

« back to all changes in this revision

Viewing changes to etc/mkinstalldirs

  • Committer: Bazaar Package Importer
  • Author(s): Nathaniel McCallum
  • Date: 2004-09-03 15:15:33 UTC
  • Revision ID: james.westby@ubuntu.com-20040903151533-px02yqlrchs4fv2t
Tags: upstream-4.0.2
ImportĀ upstreamĀ versionĀ 4.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Make directory hierarchy. 
 
3
# Written by Noah Friedman <friedman@prep.ai.mit.edu>
 
4
# Public domain.
 
5
 
 
6
defaultIFS='    
 
7
'
 
8
IFS="${IFS-${defaultIFS}}"
 
9
 
 
10
errstatus=0
 
11
 
 
12
for file in ${1+"$@"} ; do 
 
13
   oIFS="${IFS}"
 
14
   # Some sh's can't handle IFS=/ for some reason.
 
15
   IFS='%'
 
16
   set - `echo ${file} | sed -e 's@/@%@g' -e 's@^%@/@'`
 
17
   IFS="${oIFS}"
 
18
 
 
19
   pathcomp=''
 
20
 
 
21
   for d in ${1+"$@"} ; do
 
22
     pathcomp="${pathcomp}${d}"
 
23
 
 
24
     if test ! -d "${pathcomp}"; then
 
25
        echo "mkdir $pathcomp" 1>&2
 
26
        mkdir "${pathcomp}" || errstatus=$?
 
27
     fi
 
28
 
 
29
     pathcomp="${pathcomp}/"
 
30
   done
 
31
done
 
32
 
 
33
exit $errstatus
 
34
 
 
35
# eof