<<< Date Index >>>     <<< Thread Index >>>

[PATCH 2 of 2] Drop mkinstalldirs, use install-sh -d instead



# HG changeset patch
# User Matthias Andree <matthias.andree@xxxxxx>
# Date 1247005293 -7200
# Branch HEAD
# Node ID 0db1e3f4e875d07f0d663023f631f43d6b1cd1f9
# Parent  79480ef7658cc3bb64c1add23ef2b9a9e4c06ab8
Drop mkinstalldirs, use install-sh -d instead.

This requires that we use autoconf 2.60 and automake 1.10 or newer to
avoid race conditions in older versions of mkinstalldirs and install-sh.

diff -r 79480ef7658c -r 0db1e3f4e875 Makefile.am
--- a/Makefile.am       Tue Jul 07 22:55:24 2009 +0200
+++ b/Makefile.am       Wed Jul 08 00:21:33 2009 +0200
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 ## Use aclocal -I m4; automake --foreign
 
-AUTOMAKE_OPTIONS = 1.6 foreign
+AUTOMAKE_OPTIONS = 1.10 foreign
 EXTRA_PROGRAMS = mutt_dotlock pgpring pgpewrap mutt_md5
 
 if BUILD_IMAP
@@ -143,7 +143,7 @@
        fi
 
 install-data-local:
-       $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+       $(MKDIR_P) -- $(DESTDIR)$(sysconfdir)
        $(INSTALL) -m 644 $(srcdir)/mime.types 
$(DESTDIR)$(sysconfdir)/mime.types.dist
        -if [ ! -f $(DESTDIR)$(sysconfdir)/mime.types ]; then \
                $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir); 
\
diff -r 79480ef7658c -r 0db1e3f4e875 configure.ac
--- a/configure.ac      Tue Jul 07 22:55:24 2009 +0200
+++ b/configure.ac      Wed Jul 08 00:21:33 2009 +0200
@@ -3,7 +3,7 @@
 dnl !!! WHEN ADDING NEW CONFIGURE TESTS, PLEASE ADD CODE TO MAIN.C !!!
 dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED            !!!
 
-AC_PREREQ([2.54])
+AC_PREREQ([2.60])
 AC_INIT([mutt.h])
 AM_CONFIG_HEADER([config.h])
 
diff -r 79480ef7658c -r 0db1e3f4e875 contrib/Makefile.am
--- a/contrib/Makefile.am       Tue Jul 07 22:55:24 2009 +0200
+++ b/contrib/Makefile.am       Wed Jul 08 00:21:33 2009 +0200
@@ -14,7 +14,7 @@
        iconv/make.sh
 
 install-data-local:
-       $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/samples 
$(DESTDIR)$(docdir)/samples/iconv
+       $(MKDIR_P) -- $(DESTDIR)$(docdir)/samples 
$(DESTDIR)$(docdir)/samples/iconv
        for f in $(SAMPLES) ; do \
                $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir)/samples ;   
\
        done
diff -r 79480ef7658c -r 0db1e3f4e875 doc/Makefile.am
--- a/doc/Makefile.am   Tue Jul 07 22:55:24 2009 +0200
+++ b/doc/Makefile.am   Wed Jul 08 00:21:33 2009 +0200
@@ -49,9 +49,9 @@
 makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-rc 
stamp-doc-chunked manual.txt
 
 install-data-local: makedoc-all instdoc
-       $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
-       $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man5
-       $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
+       $(MKDIR_P) -- $(DESTDIR)$(mandir)/man1
+       $(MKDIR_P) -- $(DESTDIR)$(mandir)/man5
+       $(MKDIR_P) -- $(DESTDIR)$(sysconfdir)
        ./instdoc mutt.1 $(DESTDIR)$(mandir)/man1/mutt.1
        ./instdoc smime_keys.1 $(DESTDIR)$(mandir)/man1/smime_keys.1
        ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/flea.1
@@ -61,7 +61,7 @@
        ./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5
        ./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5
        ./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5
-       $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
+       $(MKDIR_P) -- $(DESTDIR)$(docdir)
        for f in $(topsrcdir_DOCFILES) ; do \
                $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
        done
diff -r 79480ef7658c -r 0db1e3f4e875 intl/Makefile.in
--- a/intl/Makefile.in  Tue Jul 07 22:55:24 2009 +0200
+++ b/intl/Makefile.in  Wed Jul 08 00:21:33 2009 +0200
@@ -41,7 +41,8 @@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo 
"$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
+install_sh = @install_sh@
+mkinstalldirs = $(install_sh) -d
 
 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
 
diff -r 79480ef7658c -r 0db1e3f4e875 mkinstalldirs
--- a/mkinstalldirs     Tue Jul 07 22:55:24 2009 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@xxxxxxxxxxxxxxx>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-dirmode=""
-
-usage="\
-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
-      ;;
-    --)                         # stop option processing
-      shift
-      break
-      ;;
-    -*)                         # unknown option
-      echo "$usage" 1>&2
-      exit 1
-      ;;
-    *)                          # first non-opt arg
-      break
-      ;;
-  esac
-done
-
-for file
-do
-  if test -d "$file"; then
-    shift
-  else
-    break
-  fi
-done
-
-case $# in
-  0) exit 0 ;;
-esac
-
-case $dirmode in
-  '')
-    if mkdir -p -- . 2>/dev/null; then
-      echo "mkdir -p -- $*"
-      exec mkdir -p -- "$@"
-    fi
-    ;;
-  *)
-    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
-      echo "mkdir -m $dirmode -p -- $*"
-      exec mkdir -m "$dirmode" -p -- "$@"
-    fi
-    ;;
-esac
-
-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
-
-    if test ! -d "$pathcomp"; then
-      echo "mkdir $pathcomp"
-
-      mkdir "$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
-
-    pathcomp="$pathcomp/"
-  done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# End:
-# mkinstalldirs ends here
diff -r 79480ef7658c -r 0db1e3f4e875 po/Makefile.in.in
--- a/po/Makefile.in.in Tue Jul 07 22:55:24 2009 +0200
+++ b/po/Makefile.in.in Wed Jul 08 00:21:33 2009 +0200
@@ -30,7 +30,8 @@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo 
"$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
+install_sh = @install_sh@
+mkinstalldirs = $(install_sh) -d
 
 CC = @CC@
 GMSGFMT = @GMSGFMT@