m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/bootstrap,v


From: Gary V. Vaughan
Subject: Changes to m4/bootstrap,v
Date: Thu, 13 Jul 2006 15:58:56 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Gary V. Vaughan <gary>  06/07/13 15:58:56

Index: bootstrap
===================================================================
RCS file: /sources/m4/m4/bootstrap,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- bootstrap   13 Jun 2006 15:41:38 -0000      1.32
+++ bootstrap   13 Jul 2006 15:58:56 -0000      1.33
@@ -1,7 +1,44 @@
 #! /bin/sh
 
-# helps bootstrapping M4, when checked out from CVS
-# requires GNU Gettext and bleeding edge GNU Autoconf, Automake & Libtool
+# bootstrap (GNU M4) version 2006-07-13
+# Written by Gary V. Vaughan  <address@hidden>
+
+# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, a copy can be downloaded from
+# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# Usage: $progname [options]
+
+# -p ARG  --download-po=ARG  whether to download pofiles [yes]
+# -v      --version          print version information
+# -h,-?   --help             print short or long help message
+
+# You can also set the following variables to help $progname
+# locate the right tools:
+#   AUTORECONF, AWK, GNULIB_TOOL, RM, SED, WGET
+
+# This script bootstraps a CVS checkout of GNU M4 by correctly
+# calling out to parts of the GNU Build Platform.  Currently this
+# requires the latest releases of GNU Gettext and Autoconf, and
+# bleeding edge CVS snapshots of GNU Automake, Libtool & Gnulib.
+
+# Report bugs to <address@hidden>
 
 : ${AUTORECONF=autoreconf}
 : ${AWK=awk}
@@ -33,6 +70,7 @@
 
 # The name of this program:
 progname=`echo "$progpath" | $SED "$basename"`
+PROGRAM=bootstrap
 
 # func_echo arg...
 # Echo program name prefixed message.
@@ -48,6 +86,145 @@
     echo $progname: ${1+"$@"} >&2
 }
 
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_error ${1+"$@"}
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+   func_error "missing argument for $1"
+   exit_cmd=exit
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "Try \`$progname --help' for more information."
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+   func_error "missing argument for $1"
+   exit_cmd=exit
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED '/^# Usage:/,/# -h/ {
+        s/^# //; s/^# *$//;
+       s/\$progname/'$progname'/;
+       p;
+    }; d' < "$progpath"
+    echo
+    echo "run \`$progname --help | more' for full usage"
+    exit $EXIT_SUCCESS
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $SED '/^# Usage:/,/# Report bugs to/ {
+        s/^# //; s/^# *$//;
+       s/\$progname/'$progname'/;
+       p;
+     }; d' < "$progpath"
+    exit $EXIT_SUCCESS
+}
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //; s/^# *$//;
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
+        p;
+     }; d' < "$progpath"
+     exit $EXIT_SUCCESS
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `commit --version' happen quickly.
+{
+  # sed scripts:
+  my_sed_single_opt='1s/^\(..\).*$/\1/;q'
+  my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
+  my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+  my_sed_long_arg='1s/^--[^=]*=//'
+
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      -p|--download-po)
+                       test $# = 0 && func_missing_arg $opt && break
+                       case $opt in
+                         0|[Nn]*|[Ff]*) DOWNLOAD_PO=no ;;
+                         [Oo]*)         DOWNLOAD_PO=only ;;
+                       esac
+                       ;;
+
+      # Separate optargs to long options:
+      --download-po=*)
+                       arg=`echo "$opt" | $SED "$my_sed_long_arg"`
+                       opt=`echo "$opt" | $SED "$my_sed_long_opt"`
+                       set -- "$opt" "$arg" ${1+"$@"}
+                       ;;
+
+      # Separate optargs to short options:
+      -p*)
+                       arg=`echo "$opt" |$SED "$my_sed_single_rest"`
+                       opt=`echo "$opt" |$SED "$my_sed_single_opt"`
+                       set -- "$opt" "$arg" ${1+"$@"}
+                       ;;
+
+      -\?|-h)          func_usage                                      ;;
+      --help)          func_help                                       ;;
+      --version)       func_version                                    ;;
+      --)              break                                           ;;
+      -*)              func_fatal_help "unrecognized option \`$opt'"   ;;
+      *)               set -- "$opt" ${1+"$@"};        break           ;;
+    esac
+  done
+
+  if test -z "$sendmail_to"; then
+
+    # can't have a from address without a destination address
+    test -n "$sendmail_from" &&
+      func_error "can't use --from without --sendmail." && exit_cmd=exit
+
+    # can't use a signature file without a destination address
+    test -n "$signature_file" &&
+      func_error "can't use --signature without --sendmail." && exit_cmd=exit
+  fi
+
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
 
 ## ------------------------------ ##
 ## Fetch translations.            ##
@@ -185,3 +362,10 @@
 fi
 
 exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "# bootstrap (GNU M4) version "
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "$"
+# End:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]