update control to reflect move of primary repo to collab-maint
[debian/sudo] / mkinstalldirs
index 935edead375c3aa7bd7abd7b3bdac0819ab5d106..0330343d68f06479825007a26a9b6c96395ef941 100755 (executable)
@@ -4,8 +4,6 @@
 # Created: 1993-05-16
 # Public domain
 
-# $Id: mkinstalldirs,v 1.3 2001/12/31 22:05:23 millert Exp $
-
 umask 022
 errstatus=0
 dirmode=""
@@ -15,61 +13,72 @@ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
 
 # process command line arguments
 while test $# -gt 0 ; do
-   case "${1}" in
-     -h | --help | --h* )                      # -h for help
-        echo "${usage}" 1>&2; exit 0 ;;
-     -m )                                      # -m PERM arg
-        shift
-        test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
-        dirmode="${1}"
-        shift ;;
-     -- ) shift; break ;;                      # stop option processing
-     -* ) echo "${usage}" 1>&2; exit 1 ;;      # unknown option
-     * )  break ;;                             # first non-opt arg
-   esac
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage" 1>&2
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
 done
 
 for file
 do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
-
-   pathcomp=
-   for d
-   do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
 
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp"
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
 
-        mkdir "$pathcomp" || lasterr=$?
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
 
-        if test ! -d "$pathcomp"; then
-         errstatus=$lasterr
-       else
-         if test ! -z "$dirmode"; then
-            echo "chmod $dirmode $pathcomp"
+      mkdir "$pathcomp" || lasterr=$?
 
-            lasterr=""
-            chmod $dirmode "$pathcomp" || lasterr=$?
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=""
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
 
-            if test ! -z "$lasterr"; then
-              errstatus=$lasterr
-            fi
-         fi
-        fi
-     fi
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
 
-     pathcomp="$pathcomp/"
-   done
+    pathcomp="$pathcomp/"
+  done
 done
 
 exit $errstatus
 
 # Local Variables:
-# mode:shell-script
-# sh-indentation:3
+# mode: shell-script
+# sh-indentation: 2
 # End:
+# mkinstalldirs ends here