m4-patches
[Top][All Lists]
Advanced

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

FYI: 72-gary-gnulib-version-etc-import.patch


From: Gary V. Vaughan
Subject: FYI: 72-gary-gnulib-version-etc-import.patch
Date: Tue, 16 Sep 2003 16:59:29 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2

Applied to HEAD.
--
  ())_.  Gary V. Vaughan    gary@(lilith.warpmail.net|gnu.org)
  ( '/   Research Scientist http://www.oranda.demon.co.uk       ,_())____
  / )=   GNU Hacker         http://www.gnu.org/software/libtool  \'      `&
`(_~)_   Tech' Author       http://sources.redhat.com/autobook   =`---d__/
Index: ChangeLog
from  Gary V. Vaughan  <address@hidden>
        * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
        version-etc module from CVS gnulib.
        * po/POTFILES.in: Add gnulib/m4/version-etc.c.
        * src/Makefile.am: Build it.
        * src/main.c: Use it.

Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/m4/m4/src/Makefile.am,v
retrieving revision 1.13
diff -u -p -u -r1.13 Makefile.am
--- src/Makefile.am 15 Sep 2003 10:00:03 -0000 1.13
+++ src/Makefile.am 16 Sep 2003 15:52:34 -0000
@@ -26,6 +26,8 @@ bin_PROGRAMS          = m4
 m4_SOURCES             = $(top_srcdir)/gnulib/m4/getopt.c      \
                          $(top_srcdir)/gnulib/m4/getopt1.c     \
                          $(top_srcdir)/gnulib/m4/getopt.h      \
+                         $(top_srcdir)/gnulib/m4/version-etc.c \
+                         $(top_srcdir)/gnulib/m4/version-etc.h \
                          main.c m4.h freeze.c stackovf.c
 m4_LDADD               = $(top_builddir)/m4/libm4.la
 m4_LDFLAGS             = -no-undefined -export-dynamic $(DLPREOPEN)
Index: src/main.c
===================================================================
RCS file: /cvsroot/m4/m4/src/main.c,v
retrieving revision 1.53
diff -u -p -u -r1.53 main.c
--- src/main.c 12 Sep 2003 15:17:49 -0000 1.53
+++ src/main.c 16 Sep 2003 15:52:34 -0000
@@ -21,8 +21,9 @@
 
 #include "m4.h"
 #include "m4private.h"
-#include "m4/progname.h"
 #include "m4/getopt.h"
+#include "m4/progname.h"
+#include "m4/version-etc.h"
 
 static void print_program_name_CB (void);
 
@@ -217,9 +218,15 @@ main (int argc, char *const *argv, char 
 
   int exit_status;
 
+  /* Initialise gnulib error module.  */
   set_program_name (argv[0]);
   error_print_progname = print_program_name_CB;
 
+  /* Initialise gnulib version-etc module.  
+     Do *not* mark this string for translation.  */
+  version_etc_copyright        =
+    "Copyright (C) 1989-1994, 1999, 2000 Free Software Foundation, Inc.";
+
   setlocale (LC_ALL, "");
 #ifdef ENABLE_NLS
   textdomain(PACKAGE);
@@ -367,17 +374,8 @@ main (int argc, char *const *argv, char 
 
   if (show_version)
     {
-      printf ("GNU %s %s%s\n", PACKAGE, VERSION, TIMESTAMP);
-      fputs (_("Written by Rene' Seindal and Gary V. Vaughan.\n"), stdout);
-      putc ('\n', stdout);
-
-      fputs (_("Copyright (C) 1989-1994, 1999, 2000 Free Software Foundation, 
Inc."), stdout);
-      putc ('\n', stdout);
-
-      fputs (_("\
-This is free software; see the source for copying conditions.  There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.\n"),
-        stdout);
+      version_etc (stdout, NULL, "GNU " PACKAGE, VERSION TIMESTAMP,
+                  _("Written by Rene' Seindal and Gary V. Vaughan."));
       exit (EXIT_SUCCESS);
     }
 
Index: gnulib/m4/version-etc.c
===================================================================
RCS file: gnulib/m4/version-etc.c
diff -N gnulib/m4/version-etc.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnulib/m4/version-etc.c 16 Sep 2003 15:52:34 -0000
@@ -0,0 +1,67 @@
+/* Utility to help print --version output in a consistent format.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   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, 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, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+/* Written by Jim Meyering. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include "unlocked-io.h"
+#include "version-etc.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+/* Default copyright goes to the FSF. */
+
+char* version_etc_copyright =
+  /* Do *not* mark this string for translation.  */
+  "Copyright (C) 2003 Free Software Foundation, Inc.";
+
+
+/* Display the --version information the standard way.
+
+   If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of
+   the program.  The formats are therefore:
+
+   PACKAGE VERSION
+
+   or
+
+   COMMAND_NAME (PACKAGE) VERSION.  */
+void
+version_etc (FILE *stream,
+            const char *command_name, const char *package,
+            const char *version, const char *authors)
+{
+  if (command_name)
+    fprintf (stream, "%s (%s) %s\n", command_name, package, version);
+  else
+    fprintf (stream, "%s %s\n", package, version);
+  fprintf (stream, "%s\n", authors);
+  putc ('\n', stream);
+
+  fputs (version_etc_copyright, stream);
+  putc ('\n', stream);
+
+  fputs (_("\
+This is free software; see the source for copying conditions.  There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.\n"),
+        stream);
+}
Index: gnulib/m4/version-etc.h
===================================================================
RCS file: gnulib/m4/version-etc.h
diff -N gnulib/m4/version-etc.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gnulib/m4/version-etc.h 16 Sep 2003 15:52:34 -0000
@@ -0,0 +1,31 @@
+/* Utility to help print --version output in a consistent format.
+   Copyright (C) 1999, 2003 Free Software Foundation, Inc.
+
+   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, 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, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+/* Written by Jim Meyering. */
+
+#ifndef VERSION_ETC_H
+# define VERSION_ETC_H 1
+
+# include <stdio.h>
+
+extern char *version_etc_copyright;
+
+void version_etc (FILE *stream,
+                 const char *command_name, const char *package,
+                 const char *version, const char *authors);
+
+#endif /* VERSION_ETC_H */

reply via email to

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