/[groff]/groff/mkinstalldirs
ViewVC logotype

Diff of /groff/mkinstalldirs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wlemb, Tue May 4 16:54:39 2004 UTC revision 1.3 by wl, Sun Sep 4 10:02:23 2005 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2  # mkinstalldirs --- make directory hierarchy  # mkinstalldirs --- make directory hierarchy
3    
4  scriptversion=2004-02-15.20  scriptversion=2005-06-29.22
5    
6  # Original author: Noah Friedman <friedman@prep.ai.mit.edu>  # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
7  # Created: 1993-05-16  # Created: 1993-05-16
# Line 12  scriptversion=2004-02-15.20 Line 12  scriptversion=2004-02-15.20
12  # <automake-patches@gnu.org>.  # <automake-patches@gnu.org>.
13    
14  errstatus=0  errstatus=0
15  dirmode=""  dirmode=
16    
17  usage="\  usage="\
18  Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...  Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
# Line 27  while test $# -gt 0 ; do Line 27  while test $# -gt 0 ; do
27    case $1 in    case $1 in
28      -h | --help | --h*)         # -h for help      -h | --help | --h*)         # -h for help
29        echo "$usage"        echo "$usage"
30        exit 0        exit $?
31        ;;        ;;
32      -m)                         # -m PERM arg      -m)                         # -m PERM arg
33        shift        shift
# Line 37  while test $# -gt 0 ; do Line 37  while test $# -gt 0 ; do
37        ;;        ;;
38      --version)      --version)
39        echo "$0 $scriptversion"        echo "$0 $scriptversion"
40        exit 0        exit $?
41        ;;        ;;
42      --)                         # stop option processing      --)                         # stop option processing
43        shift        shift
# Line 103  esac Line 103  esac
103    
104  for file  for file
105  do  do
106    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`    case $file in
107        /*) pathcomp=/ ;;
108        *)  pathcomp= ;;
109      esac
110      oIFS=$IFS
111      IFS=/
112      set fnord $file
113    shift    shift
114      IFS=$oIFS
115    
   pathcomp=  
116    for d    for d
117    do    do
118      pathcomp="$pathcomp$d"      test "x$d" = x && continue
119    
120        pathcomp=$pathcomp$d
121      case $pathcomp in      case $pathcomp in
122        -*) pathcomp=./$pathcomp ;;        -*) pathcomp=./$pathcomp ;;
123      esac      esac
# Line 124  do Line 132  do
132        else        else
133          if test ! -z "$dirmode"; then          if test ! -z "$dirmode"; then
134            echo "chmod $dirmode $pathcomp"            echo "chmod $dirmode $pathcomp"
135            lasterr=""            lasterr=
136            chmod "$dirmode" "$pathcomp" || lasterr=$?            chmod "$dirmode" "$pathcomp" || lasterr=$?
137    
138            if test ! -z "$lasterr"; then            if test ! -z "$lasterr"; then
# Line 134  do Line 142  do
142        fi        fi
143      fi      fi
144    
145      pathcomp="$pathcomp/"      pathcomp=$pathcomp/
146    done    done
147  done  done
148    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26