Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:1695c00b1aacc762208e1557acbf9e2a679071ee
Author...:Sami Kerola
Committer:Sami Kerola
Date.....:Sun Jan 20 19:54:58 2019 +0000
Parents..:30d4b742eadd600f18b3d26ec1b24dc420812805

Message
maint: use version and bug report printing from gnulib

* bootstrap.conf: include propername and version-etc-fsf modules.
* configure.ac: remove no-longer needed COPYRIGHT_YEAR.
* Makefile.am: add empty MAINTAINERCLEANFILES variable.
* src/hello.c: use version_etc() and emit_bug_reporting_address().
* po/POTFILES.in: add lib/version-etc.c to translations sources.

Changes
diff --git a/Makefile.am b/Makefile.am
line changes: +1/-0
index 101d014..5576d24
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,7 @@ localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 
 CLEANFILES =
+MAINTAINERCLEANFILES =
 
 if !GIT_CROSS_COMPILING
 man_MANS = hello.1

diff --git a/bootstrap.conf b/bootstrap.conf
line changes: +2/-0
index 20c1d53..9d5f694
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -35,9 +35,11 @@ gnulib_modules="
     mbsrtowcs
     non-recursive-gnulib-prefix-hack
     progname
+    propername
     readme-release
     stdnoreturn
     update-copyright
+    version-etc-fsf
     wchar
 "
 

diff --git a/configure.ac b/configure.ac
line changes: +0/-4
index 4960dbf..71575e4
--- a/configure.ac
+++ b/configure.ac
@@ -40,10 +40,6 @@ dnl keep everything together.
 gl_EARLY
 gl_INIT
 
-dnl Copyright will apply as long as these sources are in use, e.g., are
-dnl being compiled, which is reasonable year to claim the copyright.
-AC_DEFINE([COPYRIGHT_YEAR], [m4_esyscmd([date +%Y])], [year in copyright message])
-
 dnl Are we building from git checked-out sources, or a tarball ?
 dnl This is used in "Makefile.am" to avoid re-generating the manpage
 dnl when building from tarballs.

diff --git a/po/POTFILES.in b/po/POTFILES.in
line changes: +1/-0
index 94b3836..2b5bb81
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,4 +14,5 @@ lib/error.c
 lib/getopt.c
 lib/closeout.c
 lib/quotearg.c
+lib/version-etc.c
 lib/xalloc-die.c

diff --git a/src/hello.c b/src/hello.c
line changes: +13/-40
index 80a3213..9be4134
--- a/src/hello.c
+++ b/src/hello.c
@@ -30,8 +30,19 @@
 #include "error.h"
 #include "gettext.h"
 #include "progname.h"
+#include "propername.h"
+#include "version-etc.h"
 #include "xalloc.h"
 
+/* The official name of this program (e.g., no 'g' prefix).  */
+#define PROGRAM_NAME "hello"
+
+#define AUTHORS \
+  proper_name ("Karl Berry"), \
+  proper_name ("Sami Kerola"), \
+  proper_name ("Jim Meyering"), \
+  proper_name ("Reuben Thomas")
+
 /* Forward declarations.  */
 static _Noreturn void print_help (FILE *restrict out);
 static void print_version (void);
@@ -82,7 +93,7 @@ main (int argc, char *argv[])
       {
 	/* --help and --version exit immediately, per GNU coding standards.  */
       case OPT_VERSION:
-	print_version ();
+	version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION, AUTHORS, (char *) NULL);
 	exit (EXIT_SUCCESS);
 	break;
       case 'g':
@@ -143,12 +154,7 @@ print_help (FILE *restrict out)
   fputs ("\n", out);
   fputs (_("      --help     display this help and exit\n"), out);
   fputs (_("      --version  output version information and exit\n"), out);
-  fputs ("\n", out);
-  /* TRANSLATORS: --help output 4+ (reports)
-     TRANSLATORS: the placeholder indicates the bug-reporting address
-     for this application.
-     no-wrap */
-  fprintf (out, _("Report bugs to: %s\n"), PACKAGE_BUGREPORT);
+  emit_bug_reporting_address();
   /* Don't output this redundant message for English locales.
      Note we still output for 'C' so that it gets included in the man page.  */
   if (lc_messages && STRNCMP_LIT (lc_messages, "en_"))
@@ -160,38 +166,5 @@ print_help (FILE *restrict out)
       fprintf (out, _("Report %s translation bugs to "
 		"<https://translationproject.org/team/>\n"), PACKAGE_NAME);
     }
-#ifdef PACKAGE_PACKAGER_BUG_REPORTS
-  fprintf (out, _("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
-	  PACKAGE_PACKAGER_BUG_REPORTS);
-#endif
-#ifdef PACKAGE_URL
-  fprintf (out, _("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
-#else
-  fprintf (out, _("%s home page: <https://www.gnu.org/software/%s/>\n"),
-	  PACKAGE_NAME, PACKAGE);
-#endif
-  fputs (_("General help using GNU software: <https://www.gnu.org/gethelp/>\n"),
-	 out);
   exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }
-
-
-
-/* Print version and copyright information.  */
-
-static void
-print_version (void)
-{
-  printf ("%s (%s) %s\n", PACKAGE, PACKAGE_NAME, VERSION);
-  /* xgettext: no-wrap */
-  puts ("");
-
-  /* It is important to separate the year from the rest of the message,
-     as done here, to avoid having to retranslate the message when a new
-     year comes around.  */
-  printf (_("\
-Copyright (C) %d Free Software Foundation, Inc.\n\
-License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n\
-This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
-}

This website is licensed under AGPL-3.0. Feel free to copy!