~ubuntu-branches/debian/wheezy/nano/wheezy

« back to all changes in this revision

Viewing changes to mkinstalldirs

Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# mkinstalldirs --- make directory hierarchy
3
3
 
4
 
scriptversion=2005-02-02.21
 
4
scriptversion=2005-06-29.22
5
5
 
6
6
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
7
7
# Created: 1993-05-16
12
12
# <automake-patches@gnu.org>.
13
13
 
14
14
errstatus=0
15
 
dirmode=""
 
15
dirmode=
16
16
 
17
17
usage="\
18
18
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
103
103
 
104
104
for file
105
105
do
106
 
  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
 
106
  case $file in
 
107
    /*) pathcomp=/ ;;
 
108
    *)  pathcomp= ;;
 
109
  esac
 
110
  oIFS=$IFS
 
111
  IFS=/
 
112
  set fnord $file
107
113
  shift
 
114
  IFS=$oIFS
108
115
 
109
 
  pathcomp=
110
116
  for d
111
117
  do
112
 
    pathcomp="$pathcomp$d"
 
118
    test "x$d" = x && continue
 
119
 
 
120
    pathcomp=$pathcomp$d
113
121
    case $pathcomp in
114
122
      -*) pathcomp=./$pathcomp ;;
115
123
    esac
124
132
      else
125
133
        if test ! -z "$dirmode"; then
126
134
          echo "chmod $dirmode $pathcomp"
127
 
          lasterr=""
 
135
          lasterr=
128
136
          chmod "$dirmode" "$pathcomp" || lasterr=$?
129
137
 
130
138
          if test ! -z "$lasterr"; then
134
142
      fi
135
143
    fi
136
144
 
137
 
    pathcomp="$pathcomp/"
 
145
    pathcomp=$pathcomp/
138
146
  done
139
147
done
140
148