]> Dogcows Code - chaz/tar/commitdiff
Fix testsuite and bootstrap. Implement -I.
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 29 Dec 2008 09:27:00 +0000 (09:27 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 29 Dec 2008 09:27:00 +0000 (09:27 +0000)
* bootstrap.conf: Include size_max.
* gnulib.modules: Remove memset, rmdir. Replace strdup with
strdup-posix. Patch by Eric Blake.
* src/tar.c: Implement -I as a shorthand for --use-compress-program.
* doc/tar.texi: Document -I.
* tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
size' output.
* tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
(AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.

ChangeLog
bootstrap.conf
doc/tar.texi
gnulib.modules
src/tar.c
tests/pipe.at
tests/shortrec.at
tests/testsuite.at

index 7dd05f813922bdf51b3a04afd489f419b3025033..68fe50a619d120826c96e94fc6a975c0cb9319a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
+
+       * bootstrap.conf: Include size_max.
+       * gnulib.modules: Remove memset, rmdir. Replace strdup with
+       strdup-posix. Patch by Eric Blake.
+       * src/tar.c: Implement -I as a shorthand for --use-compress-program.
+       * doc/tar.texi: Document -I.
+       * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
+       size' output.
+       * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
+       (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
+
 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
 
        * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
index 0071201b89833a4bf5864ad399c77148e4e13a79..96cb606730e63cbbe572e3394d3263bb53ead18f 100644 (file)
@@ -1,6 +1,6 @@
 # Bootstrap configuration.
 
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 2008 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
@@ -22,7 +22,6 @@
 # includes them because of gettext dependencies.
 avoided_gnulib_modules='
        --avoid=lock
-       --avoid=size_max
 '
 
 # gnulib modules used by this package.
@@ -52,7 +51,6 @@ excluded_files='
     m4/lcmessage.m4
     m4/lock.m4
     m4/printf-posix.m4
-    m4/size_max.m4
     m4/uintmax_t.m4
     m4/ulonglong.m4
     m4/visibility.m4
index cb8bd19b900190ada00fc167b203d47091e6ffbd..210639e03faac6d25210f7a16198d26822f04189 100644 (file)
@@ -3309,6 +3309,7 @@ name quoting}.
 
 @opsummary{use-compress-program}
 @item --use-compress-program=@var{prog}
+@itemx -I=@var{prog}
 
 Instructs @command{tar} to access the archive through @var{prog}, which is
 presumed to be a compression program of some sort.  @xref{gzip}.
@@ -8570,6 +8571,7 @@ Filter the archive through @command{compress}.  Otherwise like @option{--gzip}.
 
 @opindex use-compress-program
 @item --use-compress-program=@var{prog}
+@itemx -I=@var{prog}
 Use external compression program @var{prog}.  Use this option if you
 have a compression program that @GNUTAR{} does not support.  There
 are two requirements to which @var{prog} should comply:
@@ -8608,14 +8610,14 @@ Suppose you name it @file{gpgz} and save it somewhere in your
 archive signed with your private key:
 
 @smallexample
-$ @kbd{tar -cf foo.tar.gpgz --use-compress=gpgz .}
+$ @kbd{tar -cf foo.tar.gpgz -Igpgz .}
 @end smallexample
 
 @noindent
-Likewise, the following command will list its contents:
+Likewise, the command below will list its contents:
 
 @smallexample
-$ @kbd{tar -tf foo.tar.gpgz --use-compress=gpgz .}
+$ @kbd{tar -tf foo.tar.gpgz -Igpgz .}
 @end smallexample
 
 @ignore
index a3c2cf736b56ee7f7be1500dcd98dd5bc4fec7c1..e5df90447833386544b4a7e0b86e67e1be850b9b 100644 (file)
@@ -27,13 +27,11 @@ human
 inttypes
 lchown
 localcharset
-memset
 mkdtemp
 modechange
 obstack
 quote
 quotearg
-rmdir
 rpmatch
 safe-read
 save-cwd
@@ -44,7 +42,7 @@ stat-time
 stdbool
 stdint
 stpcpy
-strdup
+strdup-posix
 strerror
 strtol
 strtoul
index ae0c739f01aa2bbe77a73c6d962dbd96cf4663bf..8396ad5e4e4e753f2c6284643b1939b7a52e3887 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -323,7 +323,6 @@ enum
   TRANSFORM_OPTION,
   UNQUOTE_OPTION,
   USAGE_OPTION,
-  USE_COMPRESS_PROGRAM_OPTION,
   UTC_OPTION,
   VERSION_OPTION,
   VOLNO_FILE_OPTION,
@@ -352,7 +351,7 @@ The version control may be set with --backup or VERSION_CONTROL, values are:\n\n
 
 /* NOTE:
 
-   Available option letters are DEIQY and eqy. Consider the following
+   Available option letters are DEQY and eqy. Consider the following
    assignments:
 
    [For Solaris tar compatibility =/= Is it important at all?]
@@ -360,7 +359,6 @@ The version control may be set with --backup or VERSION_CONTROL, values are:\n\n
    E  use extended headers (--format=posix)
 
    [q  alias for --occurrence=1 =/= this would better be used for quiet?]
-   [I  same as T =/= will harm star compatibility]
 
    y  per-file gzip compression
    Y  per-block gzip compression */
@@ -610,7 +608,7 @@ static struct argp_option options[] = {
    N_("filter the archive through lzma"), GRID+1 },
   {"lzop", LZOP_OPTION, 0, 0,
    N_("filter the archive through lzop"), GRID+8 },
-  {"use-compress-program", USE_COMPRESS_PROGRAM_OPTION, N_("PROG"), 0,
+  {"use-compress-program", 'I', N_("PROG"), 0,
    N_("filter through PROG (must accept -d)"), GRID+1 },
 #undef GRID
   
@@ -1364,12 +1362,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
       ignore_zeros_option = true;
       break;
 
-    case 'I':
-      USAGE_ERROR ((0, 0,
-                   _("Warning: the -I option is not supported;"
-                     " perhaps you meant -j or -T?")));
-      break;
-
     case 'j':
       set_use_compress_program_option ("bzip2");
       break;
@@ -1905,7 +1897,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
       set_transform_expr (arg);
       break;
 
-    case USE_COMPRESS_PROGRAM_OPTION:
+    case 'I':
       set_use_compress_program_option (arg);
       break;
 
index efca65b19a83dd66807ba12ed8a822961bfdb224..be992126288bb6ae8a9f2a8dc67b201719e4e96b 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autom4te to create testsuite. -*- Autotest -*-
 
 # Test suite for GNU tar.
-# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2007, 2008 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
@@ -30,7 +30,8 @@ AT_SETUP([decompressing from stdin])
 
 AT_KEYWORDS([pipe])
 
-AT_TAR_CHECK([
+AT_TAR_WITH_HOOK([TAR_IGNREC_HOOK],
+[AT_TAR_CHECK([
 AT_SORT_PREREQ
 
 mkdir directory
@@ -49,6 +50,7 @@ directory/file1
 directory/file2
 separator
 separator
-])
+],
+[stderr])])
 
 AT_CLEANUP
index 3e009fd39e4776e08ca040a2a1dbadabd23c8bd4..179f36564cfe9a976624bbfd8a26c485ccfdadd0 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autom4te to create testsuite. -*- Autotest -*-
 
 # Test suite for GNU tar.
-# Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007, 2008 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
 # used to create the archive.
 
 AT_SETUP([short records])
-AT_KEYWORDS([shortrec.at])
+AT_KEYWORDS([shortrec])
 
-AT_TAR_CHECK([
+AT_TAR_WITH_HOOK([TAR_IGNREC_HOOK],
+[AT_TAR_CHECK([
 mkdir directory
 (cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - >/dev/null
+tar -c -b 1 -f - directory | tar -t -f - 
 tar -c -b 1 -f archive directory
-tar -t -f archive >/dev/null
-tar -t -f - < archive >/dev/null
+tar -t -f archive 
+tar -t -f - < archive 
 
 rm -r directory
+],
+[0],
+[ignore],
+[stderr])
 ])
 
 AT_CLEANUP
index 2fa53925c66b72d80b548baa8831413e6dd9a43d..a12477d97fb4519edd72371618458e613e9c9ea7 100644 (file)
@@ -1,7 +1,7 @@
 # Process this file with autom4te to create testsuite. -*- Autotest -*-
 
 # Test suite for GNU tar.
-# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2007, 2008 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
@@ -21,6 +21,7 @@
 # We need a recent Autotest.
 m4_version_prereq([2.52g])
 
+m4_define([AT_TAR_CHECK_HOOK])
 m4_define([AT_TAR_CHECK],[
   AT_XFAIL_IF(test -f $[]XFAILFILE)
   m4_foreach([FMT],
@@ -33,9 +34,20 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS="-H FMT"
 export TAR_OPTIONS
 rm -rf *
-$1)],$2,$3,$4,$5,$6)])
+$1)],$2,$3,$4,$5,$6)
+              AT_TAR_CHECK_HOOK])
 ])
 
+m4_define([AT_TAR_WITH_HOOK],[
+  m4_pushdef([AT_TAR_CHECK_HOOK],[$1])
+  $2
+  
+  m4_popdef([AT_TAR_CHECK_HOOK])])
+
+m4_define([TAR_IGNREC_HOOK],[
+  AT_CHECK([grep -v '^.*tar: Record size = ' stderr; exit 0])
+])
+  
 m4_define([RE_CHECK],[
 AT_DATA([$1.re],[$2])
 awk '{print NR " " $[]0}' $1 > $[]$.1
This page took 0.04857 seconds and 4 git commands to generate.