Extract gitiginore files from Subversion.
[cfd] / mkaclocal.in
index 8a56ac4..a511923 100755 (executable)
@@ -26,9 +26,7 @@
 # along with `common'; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#----- Revision history -----------------------------------------------------
-#
-# $Log$
+set -e
 
 # --- Configuration variables ---
 
@@ -132,13 +130,12 @@ EOF
 done
 
 if $stdlib; then
-  set \
-    "$datadir/aclocal.glob" \
+  set -- \
     `test -r $datadir/aclocal.site && echo "$datadir/aclocal.site"` \
     `test -r ./aclocal.lib && echo "./aclocal.lib"` \
     "$@"
 else
-  set \
+  set -- \
     `test -r ./aclocal.lib && echo "./aclocal.lib"` \
     "$@"
 fi
@@ -153,6 +150,11 @@ case $mode in
 
   x)
     t=${TMPDIR-/tmp}/mkaclocal.$$
+    doaclocal=false
+    if $stdlib && [ $out = aclocal.m4 ]; then
+      doaclocal=true
+      out=acinclude.m4
+    fi
     if mkdir -m700 $t; then :
     else
       echo >&2 "mkaclocal: cculd not create temporary directory"
@@ -180,11 +182,13 @@ $LINE"
          grep "\*@--TOP--@\*" ./aclocal.lib >/dev/null &&
          sed -e "/\*@--TOP--@\*/, $ d" ./aclocal.lib
        cat $out.tmp
-      } >$out
+      } >$out.new
+      mv $out.new $out
     else
       rm -f $out
     fi
 
     rm -fr $t $out.tmp
+    if $doaclocal; then aclocal; fi
     ;;
 esac