mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-07-27 21:42:37 +00:00
Report record size only if the archive refers to a device.
* Makefile.am (INCLUDES): Add ../lib, for rmt-command.h * src/buffer.c (short_read): Report the actual record size only if the archive descriptor refers to a device. * tests/pipe.at, tests/shortrec.at, tests/sparsemvp.at: Reflect the above change. * NEWS, configure.ac: Version 1.22.90
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
GNU tar NEWS - User visible changes. 2009-03-05
|
||||
GNU tar NEWS - User visible changes. 2009-05-25
|
||||
Please send GNU tar bug reports to <bug-tar@gnu.org>
|
||||
|
||||
|
||||
version 1.22.90 (Git)
|
||||
|
||||
* Record size autodetection
|
||||
|
||||
When listing or extracting archives, the actual record size is
|
||||
reported only if the archive is read from a device (as opposed
|
||||
to regular files and pipes).
|
||||
|
||||
|
||||
version 1.22 - Sergey Poznyakoff, 2009-03-05
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
AC_INIT([GNU tar], [1.22], [bug-tar@gnu.org])
|
||||
AC_INIT([GNU tar], [1.22.90], [bug-tar@gnu.org])
|
||||
AC_CONFIG_SRCDIR([src/tar.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ tar_SOURCES = \
|
||||
update.c\
|
||||
utf8.c
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib
|
||||
INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib -I../lib
|
||||
|
||||
LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)
|
||||
|
||||
|
||||
+15
-1
@@ -679,6 +679,19 @@ archive_read_error (void)
|
||||
return;
|
||||
}
|
||||
|
||||
static bool
|
||||
archive_is_dev ()
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (fstat (archive, &st))
|
||||
{
|
||||
stat_diag (*archive_name_cursor);
|
||||
return false;
|
||||
}
|
||||
return S_ISBLK (st.st_mode) || S_ISCHR (st.st_mode);
|
||||
}
|
||||
|
||||
static void
|
||||
short_read (size_t status)
|
||||
{
|
||||
@@ -690,7 +703,8 @@ short_read (size_t status)
|
||||
|
||||
if (left && left % BLOCKSIZE == 0
|
||||
&& verbose_option
|
||||
&& record_start_block == 0 && status != 0)
|
||||
&& record_start_block == 0 && status != 0
|
||||
&& archive_is_dev ())
|
||||
{
|
||||
unsigned long rsize = status / BLOCKSIZE;
|
||||
WARN ((0, 0,
|
||||
|
||||
+6
-7
@@ -1,7 +1,8 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004, 2005, 2006, 2007, 2008,
|
||||
# 2009 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,16 +31,15 @@ AT_SETUP([decompressing from stdin])
|
||||
|
||||
AT_KEYWORDS([pipe])
|
||||
|
||||
AT_TAR_WITH_HOOK([TAR_IGNREC_HOOK],
|
||||
[AT_TAR_CHECK([
|
||||
AT_TAR_CHECK([
|
||||
AT_SORT_PREREQ
|
||||
|
||||
mkdir directory
|
||||
genfile --length 10240 --pattern zeros --file directory/file1
|
||||
genfile --length 13 --file directory/file2
|
||||
tar cf archive directory|sort
|
||||
tar cf archive directory
|
||||
mv directory orig
|
||||
cat archive | tar xfv - | sort
|
||||
cat archive | tar xfv - | sort
|
||||
echo "separator"
|
||||
cmp orig/file1 directory/file1
|
||||
echo "separator"
|
||||
@@ -50,7 +50,6 @@ directory/file1
|
||||
directory/file2
|
||||
separator
|
||||
separator
|
||||
],
|
||||
[stderr])])
|
||||
])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
+5
-10
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2007, 2008, 2009 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
|
||||
@@ -25,20 +25,15 @@
|
||||
AT_SETUP([short records])
|
||||
AT_KEYWORDS([shortrec])
|
||||
|
||||
AT_TAR_WITH_HOOK([TAR_IGNREC_HOOK],
|
||||
[AT_TAR_CHECK([
|
||||
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 -
|
||||
tar -c -b 1 -f - directory | tar -t -f - > /dev/null
|
||||
tar -c -b 1 -f archive directory
|
||||
tar -t -f archive
|
||||
tar -t -f - < archive
|
||||
tar -t -f archive > /dev/null
|
||||
tar -t -f - < archive > /dev/null
|
||||
|
||||
rm -r directory
|
||||
],
|
||||
[0],
|
||||
[ignore],
|
||||
[stderr])
|
||||
])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
+2
-4
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2006, 2007, 2008, 2009 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
|
||||
@@ -56,7 +56,5 @@ Test archive
|
||||
sparsefile
|
||||
Compare archive
|
||||
],
|
||||
[tar: Record size = 12 blocks
|
||||
tar: Record size = 12 blocks
|
||||
],[],[],[pax])])
|
||||
[],[],[],[pax])])
|
||||
|
||||
|
||||
+2
-4
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2007, 2008, 2009 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
|
||||
@@ -52,9 +52,7 @@ Extracted directory
|
||||
abc
|
||||
abc/CCC
|
||||
],
|
||||
[tar: Record size = 5 blocks
|
||||
tar: Record size = 5 blocks
|
||||
])
|
||||
[])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
Reference in New Issue
Block a user