bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] "tar --version" changes to conform to the GNU coding standards


From: Paul Eggert
Subject: [Bug-tar] "tar --version" changes to conform to the GNU coding standards
Date: Tue, 07 Feb 2006 14:20:55 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

I just now noticed that "tar --version" stopped conforming to the GNU
coding standards in version 1.15.  I assume this was inadvertent?  I
installed the following to bring it back into conformance, by using
the gnulib version-etc-fsf module; if there's something deeper going
on that I missed, please let me know.

2006-02-07  Paul Eggert  <address@hidden>

        * NEWS: --version now outputs copyright etc., to conform to the
        GNU coding standards.  Remove --license.
        * gnulib.modules: Add version-etc-fsf.
        * doc/tar.texi: Document the change.
        * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
        * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
        * scripts/backup.in: Remove --license.  Change --version to conform
        to GCS.
        * scripts/restore.in: Likewise.
        * scripts/backup.sh.in (license): Output briefer license in the
        style of coreutils, for consistency with other changes.
        * src/tar.c: Include <version-etc.h>.
        (LICENSE_OPTION): Remove.
        (options): Remove --license.
        (license): Remove.
        (parse_opt): Use version_etc instead of rolling it ourselves.
        Remove --license.
        * tests/version.at (tar --version): Check only the first line of
        output.
        * paxutils/gnulib.modules: Add version-etc-fsf.
        * paxutils/rmt/rmt.c: Include <version-etc.h>.
        (main): Use version_etc rather than rolling our own.

Index: NEWS
===================================================================
RCS file: /cvsroot/tar/tar/NEWS,v
retrieving revision 1.111
diff -p -b -u -r1.111 NEWS
--- NEWS        7 Feb 2006 20:55:50 -0000       1.111
+++ NEWS        7 Feb 2006 22:13:18 -0000
@@ -87,6 +87,11 @@ modification times.
 ** When creating an archive, do not attempt to store files whose
 meta-data cannot be stored in the header due to format limitations
 (for ustar and v7 formats).
+** The --version option now also outputs information about copyright,
+license, and credits.  This reverts to the behavior of tar 1.14 and
+earlier, and conforms to the GNU coding standards.  The --license (-L)
+option introduced in tar 1.15 has been removed, since it's no longer
+needed.
 
 
 version 1.15.1 - Sergey Poznyakoff, 2004-12-21
Index: gnulib.modules
===================================================================
RCS file: /cvsroot/tar/tar/gnulib.modules,v
retrieving revision 1.6
diff -p -b -u -r1.6 gnulib.modules
--- gnulib.modules      11 Nov 2005 12:15:46 -0000      1.6
+++ gnulib.modules      7 Feb 2006 22:13:18 -0000
@@ -44,6 +44,7 @@ unlinkdir
 unlocked-io
 utime
 utimens
+version-etc-fsf
 xalloc
 xalloc-die
 xgetcwd
Index: doc/tar.texi
===================================================================
RCS file: /cvsroot/tar/tar/doc/tar.texi,v
retrieving revision 1.87
diff -p -b -u -r1.87 tar.texi
--- doc/tar.texi        18 Jan 2006 15:36:01 -0000      1.87
+++ doc/tar.texi        7 Feb 2006 22:13:19 -0000
@@ -3101,8 +3101,8 @@ archive.  @xref{verify}.
 @opindex version, summary
 @item --version
 
address@hidden will print an informational message about what version
-it is and a copyright message, some credits, and then exit.
+Print information about the program's name, version, origin and legal
+status, all on standard output, and then exit successfully.
 @xref{help}.
 
 @opindex volno-file, summary
@@ -3310,15 +3310,18 @@ the earlier versions of @GNUTAR{}.  In t
 @cindex Version of the @command{tar} program
 Being careful, the first thing is really checking that you are using
 @GNUTAR{}, indeed.  The @option{--version} option
-will generate a message giving confirmation that you are using
address@hidden, with the precise version of @GNUTAR{}
-you are using.  @command{tar} identifies itself and
-prints the version number to the standard output, then immediately
-exits successfully, without doing anything else, ignoring all other
-options.  For example, @address@hidden --version}} might return:
+causes @command{tar} to print information about its name, version,
+origin and legal status, all on standard output, and then exit
+successfully.  For example, @address@hidden --version}} might print:
 
 @smallexample
-tar (@acronym{GNU} tar) @value{VERSION}
+tar (GNU tar) 1.15.2
+Copyright (C) 2006 Free Software Foundation, Inc.
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+
+Written by John Gilmore and Jay Fenlason.
 @end smallexample
 
 @noindent
@@ -3330,7 +3333,7 @@ named @samp{tar}, after the name of the 
 address@hidden are plans to merge the @command{cpio} and
 @command{tar} packages into a single one which would be called
 @code{paxutils}.  So, who knows if, one of this days, the
address@hidden would not yield @address@hidden (@acronym{GNU}
address@hidden would not output @address@hidden (@acronym{GNU}
 paxutils) 3.2}}}.
 
 @cindex Obtaining help
@@ -5762,13 +5765,10 @@ Wait till @var{time}, then do backup.
 @itemx --help
 Display short help message and exit.
 
address@hidden -L
address@hidden --license
-Display program license and exit.
-
 @item -V
 @itemx --version
-Display program version and exit.
+Display information about the program's name, version, origin and legal
+status, all on standard output, and then exit successfully.
 @end table
 
 
@@ -5833,13 +5833,10 @@ is 100, which means the highest debuggin
 @itemx --help
 Display short help message and exit.
 
address@hidden -L
address@hidden --license
-Display program license and exit.
-
 @item -V
 @itemx --version
-Display program version and exit.
+Display information about the program's name, version, origin and legal
+status, all on standard output, and then exit successfully.
 @end table
 
 You should start the restore script with the media containing the
@@ -9768,4 +9765,3 @@ options. The options are listed without 
 @c Local variables:
 @c texinfo-column-for-description: 32
 @c End:
-
Index: lib/.cvsignore
===================================================================
RCS file: /cvsroot/tar/tar/lib/.cvsignore,v
retrieving revision 1.29
diff -p -b -u -r1.29 .cvsignore
--- lib/.cvsignore      9 Jan 2006 22:52:34 -0000       1.29
+++ lib/.cvsignore      7 Feb 2006 22:13:19 -0000
@@ -191,6 +191,9 @@ utimens.h
 vasnprintf.c
 vasnprintf.h
 verify.h
+version-etc-fsf.c
+version-etc.c
+version-etc.h
 vsnprintf.c
 vsnprintf.h
 xalloc-die.c
Index: scripts/Makefile.am
===================================================================
RCS file: /cvsroot/tar/tar/scripts/Makefile.am,v
retrieving revision 1.20
diff -p -b -u -r1.20 Makefile.am
--- scripts/Makefile.am 15 May 2005 03:59:09 -0000      1.20
+++ scripts/Makefile.am 7 Feb 2006 22:13:19 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006 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
@@ -31,7 +31,7 @@ CLEANFILES=backup.sh backup restore dump
 
 SED_CMD="s,address@hidden@,$(libexecdir),;\
          s,address@hidden@,$(sysconfdir),;\
-         s,address@hidden@,$(PACKAGE),;\
+         s,address@hidden@,$(PACKAGE_NAME),;\
          s,address@hidden@,$(VERSION),;\
          s,address@hidden@,$(PACKAGE_BUGREPORT),;\
          s,address@hidden@,$(DATE_FORMAT_OK),;@BACKUP_SED_COND@"
Index: scripts/backup.in
===================================================================
RCS file: /cvsroot/tar/tar/scripts/backup.in,v
retrieving revision 1.7
diff -p -b -u -r1.7 backup.in
--- scripts/backup.in   26 May 2005 12:50:11 -0000      1.7
+++ scripts/backup.in   7 Feb 2006 22:13:19 -0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # This program is part of GNU tar
-# Copyright 2004, 2005, Free Software Foundation
+# Copyright (C) 2004, 2005, 2006 Free Software Foundation
 #
 # 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
@@ -38,7 +38,6 @@ Options are:
 
 Informational options:   
    -h, --help              Display this help message.
-   -L, --license           Display program license.
    -V, --version           Display program version.
 
    Optional argument WHEN is for backward compatibility only. It has been
@@ -92,9 +91,7 @@ do
          prev=$option
         ;;
   -V|--v|--ve|--ver|--vers|--versi|--versio|--version)
-        echo "backup (@PACKAGE@ @VERSION@)"
-        exit 0;;
-  -L|--li|--lic|--lice|--licen|--licens|--license)
+        echo "backup (@PACKAGE_NAME@) @VERSION@"
         license
         exit;;
   -h|--h|--he|--hel|--help)
Index: scripts/backup.sh.in
===================================================================
RCS file: /cvsroot/tar/tar/scripts/backup.sh.in,v
retrieving revision 1.6
diff -p -b -u -r1.6 backup.sh.in
--- scripts/backup.sh.in        27 May 2005 12:03:39 -0000      1.6
+++ scripts/backup.sh.in        7 Feb 2006 22:13:19 -0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # This program is part of GNU tar
-# Copyright 2004, 2005, Free Software Foundation
+# Copyright (C) 2004, 2005, 2006 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
@@ -339,22 +339,9 @@ remote_run() {
 
 license() {
     cat - <<EOF
-    This program is part of GNU tar
-    Copyright 2004, Free Software Foundation
-
-    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 1, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301, USA.
+Copyright (C) 2006 Free Software Foundation, Inc.
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
 EOF
 }
Index: scripts/restore.in
===================================================================
RCS file: /cvsroot/tar/tar/scripts/restore.in,v
retrieving revision 1.5
diff -p -b -u -r1.5 restore.in
--- scripts/restore.in  15 May 2005 03:59:09 -0000      1.5
+++ scripts/restore.in  7 Feb 2006 22:13:19 -0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # This program is part of GNU tar
-# Copyright 2004, Free Software Foundation
+# Copyright (C) 2004, 2006 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
@@ -33,7 +33,6 @@ Options are:
 
 Informational options:   
    -h, --help              Display this help message.
-   -L, --license           Display program license.
    -V, --version           Display program version.
 
 Send bug reports to @address@hidden
@@ -72,9 +71,7 @@ do
         ;;
   -v*)   VERBOSE=`expr $option : "-v\(.*\)"`;;
   -V|--v|--ve|--ver|--vers|--versi|--versio|--version)
-        echo "restore (@PACKAGE@ @VERSION@)"
-        exit 0;;
-  -L|--li|--lic|--lice|--licen|--licens|--license)
+        echo "restore (@PACKAGE_NAME@) @VERSION@"
         license
         exit;;
   -h|--h|--he|--hel|--help)
@@ -230,8 +227,3 @@ if [ "x${BACKUP_FILES}" != "x" ] ; then
 fi) 2>&1 | tee -a "${LOGFILE}"
 
 # EOF    
-
-    
-    
-          
-       
Index: src/tar.c
===================================================================
RCS file: /cvsroot/tar/tar/src/tar.c,v
retrieving revision 1.137
diff -p -b -u -r1.137 tar.c
--- src/tar.c   21 Jan 2006 23:39:20 -0000      1.137
+++ src/tar.c   7 Feb 2006 22:13:19 -0000
@@ -42,6 +42,7 @@
 #include <rmt.h>
 #include <prepargs.h>
 #include <quotearg.h>
+#include <version-etc.h>
 #include <xstrtol.h>
 #include <stdopen.h>
 
@@ -257,7 +258,6 @@ enum
   IGNORE_FAILED_READ_OPTION,
   INDEX_FILE_OPTION,
   KEEP_NEWER_FILES_OPTION,
-  LICENSE_OPTION,
   MODE_OPTION,
   NEWER_MTIME_OPTION,
   NO_ANCHORED_OPTION,
@@ -676,7 +676,6 @@ static struct argp_option options[] = {
    
   {"help",  '?', 0, 0,  N_("Give this help list"), -1},
   {"usage", USAGE_OPTION, 0, 0,  N_("Give a short usage message"), -1},
-  {"license", LICENSE_OPTION, 0, 0, N_("Print license and exit"), -1},
   {"version", VERSION_OPTION, 0, 0,  N_("Print program version"), -1},
   /* FIXME -V (--label) conflicts with the default short option for
      --version */
@@ -744,30 +743,6 @@ set_use_compress_program_option (const c
   use_compress_program_option = string;
 }
 
-void
-license ()
-{
-  printf ("tar (%s) %s\n%s\n", PACKAGE_NAME, PACKAGE_VERSION,
-         "Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1999, \n\
-2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.\n");
-  puts (_("Based on the work of John Gilmore and Jay Fenlason. See AUTHORS\n\
-for complete list of authors.\n"));
-  printf (_("   GNU tar is free software; you can redistribute it and/or 
modify\n"
-    "   it under the terms of the GNU General Public License as published by\n"
-    "   the Free Software Foundation; either version 2 of the License, or\n"
-    "   (at your option) any later version.\n"
-    "\n"
-    "   GNU tar is distributed in the hope that it will be useful,\n"
-    "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-    "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-    "   GNU General Public License for more details.\n"
-    "\n"
-    "   You should have received a copy of the GNU General Public License\n"
-    "   along with GNU tar; if not, write to the Free Software Foundation,\n"
-    "   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA\n\n"));
-  exit (0);
-}
-
 static volatile int _argp_hang;
 
 enum read_file_list_state  /* Result of reading file name from the list file */
@@ -1638,13 +1613,10 @@ parse_opt (int key, char *arg, struct ar
       break;
 
     case VERSION_OPTION:
-      fprintf (state->out_stream, "%s\n", argp_program_version);
+      version_etc (state->out_stream, "tar", PACKAGE_NAME, VERSION,
+                  "John Gilmore", "Jay Fenlason", (char *) NULL);
       exit (0);
 
-    case LICENSE_OPTION:
-      license ();
-      break;
-
     case HANG_OPTION:
       _argp_hang = atoi (arg ? arg : "3600");
       while (_argp_hang-- > 0)
Index: tests/version.at
===================================================================
RCS file: /cvsroot/tar/tar/tests/version.at,v
retrieving revision 1.2
diff -p -b -u -r1.2 version.at
--- tests/version.at    15 May 2005 03:59:11 -0000      1.2
+++ tests/version.at    7 Feb 2006 22:13:19 -0000
@@ -1,5 +1,5 @@
 # Checking tar version                              -*- Autotest -*-
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006 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
@@ -18,10 +18,9 @@
 
 AT_SETUP([tar version])
 
-AT_CHECK([tar --version],
+AT_CHECK([tar --version | sed 1q],
          [0],
          [AT_PACKAGE_TARNAME (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
 ])
 
 AT_CLEANUP
-          
\ No newline at end of file
--- paxutils/gnulib.modules     22 Jun 2005 06:14:28 -0000      1.3
+++ paxutils/gnulib.modules     7 Feb 2006 22:17:05 -0000
@@ -11,4 +11,5 @@ quotearg
 safe-read
 stdbool
 strtol
+version-etc-fsf
 xalloc
--- paxutils/rmt/rmt.c  29 Nov 2005 19:09:16 -0000      1.8
+++ paxutils/rmt/rmt.c  7 Feb 2006 22:17:05 -0000
@@ -35,6 +35,7 @@
 #include <localedir.h>
 #include <safe-read.h>
 #include <full-write.h>
+#include <version-etc.h>
 
 #include <getopt.h>
 #include <sys/socket.h>
@@ -560,14 +561,8 @@ main (int argc, char **argv)
       usage (EXIT_SUCCESS);
 
     case 'v':
-      {
-       printf ("rmt (%s) %s\n%s\n", PACKAGE_NAME, PACKAGE_VERSION,
-               "Copyright (C) 2004 Free Software Foundation, Inc.");
-       puts (_("\
-This program comes with NO WARRANTY, to the extent permitted by law.\n\
-You may redistribute it under the terms of the GNU General Public License;\n\
-see the file named COPYING for details."));
-      }
+      version_etc (stdout, "rmt", PACKAGE_NAME, PACKAGE_VERSION,
+                  "John Gilmore", "Jay Fenlason", (char *) NULL);
       return EXIT_SUCCESS;
 
     case -1:




reply via email to

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