Compare commits
No commits in common. 'cs10' and 'c9' have entirely different histories.
@ -1,2 +1 @@
|
|||||||
SOURCES/tar-1.35.tar.xz
|
SOURCES/tar-1.34.tar.xz
|
||||||
SOURCES/tar-1.35.tar.xz.sig
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
6b9824c92deddbd7021801515270211f5252fbd8 SOURCES/tar-1.35.tar.xz
|
bb9d853e10d0753fe9063914401a7e164d51a0f0 SOURCES/tar-1.34.tar.xz
|
||||||
6740b6306f671129d0295e05aa003bfc184c8f6e SOURCES/tar-1.35.tar.xz.sig
|
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
From: Ondrej Dubaj <odubaj@redhat.com>
|
||||||
|
Date: Tue, 13 Apr 2021 11:47:32 +0200
|
||||||
|
Subject: [PATCH] do not report read disk error as file shrank
|
||||||
|
|
||||||
|
diff --git a/src/create.c b/src/create.c
|
||||||
|
index 181f7d9..7be10a9 100644
|
||||||
|
--- a/src/create.c
|
||||||
|
+++ b/src/create.c
|
||||||
|
@@ -1097,7 +1097,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
|
||||||
|
size_left -= count;
|
||||||
|
set_next_block_after (blk + (bufsize - 1) / BLOCKSIZE);
|
||||||
|
|
||||||
|
- if (count != bufsize)
|
||||||
|
+ if (count == 0)
|
||||||
|
{
|
||||||
|
char buf[UINTMAX_STRSIZE_BOUND];
|
||||||
|
memset (blk->buffer + count, 0, bufsize - count);
|
||||||
|
diff -rup tar-1.34/tests/Makefile.am.old tar-1.34/tests/Makefile.am
|
||||||
|
--- tar-1.34/tests/Makefile.am.old 2022-06-27 09:21:40.881574517 +0000
|
||||||
|
+++ tar-1.34/tests/Makefile.am 2022-06-27 09:23:31.444574517 +0000
|
||||||
|
@@ -247,7 +247,6 @@ TESTSUITE_AT = \
|
||||||
|
sptrdiff01.at\
|
||||||
|
time01.at\
|
||||||
|
time02.at\
|
||||||
|
- truncate.at\
|
||||||
|
update.at\
|
||||||
|
update01.at\
|
||||||
|
update02.at\
|
||||||
|
diff -rup tar-1.34/tests/Makefile.in.old tar-1.34/tests/Makefile.in
|
||||||
|
--- tar-1.34/tests/Makefile.in.old 2022-06-27 09:21:48.626574517 +0000
|
||||||
|
+++ tar-1.34/tests/Makefile.in 2022-06-27 09:22:03.127574517 +0000
|
||||||
|
@@ -1622,7 +1622,6 @@ TESTSUITE_AT = \
|
||||||
|
sptrdiff01.at\
|
||||||
|
time01.at\
|
||||||
|
time02.at\
|
||||||
|
- truncate.at\
|
||||||
|
update.at\
|
||||||
|
update01.at\
|
||||||
|
update02.at\
|
||||||
|
diff --git a/tests/testsuite.at b/tests/testsuite.at
|
||||||
|
index 2a83757..52f73a6 100644
|
||||||
|
--- a/tests/testsuite.at
|
||||||
|
+++ b/tests/testsuite.at
|
||||||
|
@@ -424,7 +424,6 @@ m4_include([comprec.at])
|
||||||
|
m4_include([shortfile.at])
|
||||||
|
m4_include([shortupd.at])
|
||||||
|
|
||||||
|
-m4_include([truncate.at])
|
||||||
|
m4_include([grow.at])
|
||||||
|
m4_include([sigpipe.at])
|
||||||
|
m4_include([comperr.at])
|
@ -0,0 +1,175 @@
|
|||||||
|
From 910d9ff829bbdfaf1455cdb2b1813507bcb855ec Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ondrej Dubaj <odubaj@redhat.com>
|
||||||
|
Date: Tue, 13 Apr 2021 11:47:32 +0200
|
||||||
|
Subject: [PATCH] add padding message, when read error occurs and tar is
|
||||||
|
padding with zeros
|
||||||
|
|
||||||
|
---
|
||||||
|
lib/paxerror.c | 44 ++++++++++++++++++++++++++++++--------------
|
||||||
|
lib/paxlib.h | 4 ++--
|
||||||
|
src/common.h | 2 +-
|
||||||
|
src/create.c | 2 +-
|
||||||
|
src/misc.c | 6 +++---
|
||||||
|
src/sparse.c | 6 +++---
|
||||||
|
6 files changed, 40 insertions(+), 24 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/paxerror.c b/lib/paxerror.c
|
||||||
|
index 134cef3..929a741 100644
|
||||||
|
--- a/lib/paxerror.c
|
||||||
|
+++ b/lib/paxerror.c
|
||||||
|
@@ -173,29 +173,45 @@ read_error (char const *name)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
-read_error_details (char const *name, off_t offset, size_t size)
|
||||||
|
+read_error_details (char const *name, off_t offset, size_t size, bool padding)
|
||||||
|
{
|
||||||
|
char buf[UINTMAX_STRSIZE_BOUND];
|
||||||
|
int e = errno;
|
||||||
|
- ERROR ((0, e,
|
||||||
|
- ngettext ("%s: Read error at byte %s, while reading %lu byte",
|
||||||
|
- "%s: Read error at byte %s, while reading %lu bytes",
|
||||||
|
- size),
|
||||||
|
- quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
- (unsigned long) size));
|
||||||
|
+ if (padding)
|
||||||
|
+ ERROR ((0, e,
|
||||||
|
+ ngettext ("%s: Read error at byte %s, while reading %lu byte; padding with zeros",
|
||||||
|
+ "%s: Read error at byte %s, while reading %lu bytes; padding with zeros",
|
||||||
|
+ size),
|
||||||
|
+ quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
+ (unsigned long) size));
|
||||||
|
+ else
|
||||||
|
+ ERROR ((0, e,
|
||||||
|
+ ngettext ("%s: Read error at byte %s, while reading %lu byte",
|
||||||
|
+ "%s: Read error at byte %s, while reading %lu bytes",
|
||||||
|
+ size),
|
||||||
|
+ quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
+ (unsigned long) size));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
-read_warn_details (char const *name, off_t offset, size_t size)
|
||||||
|
+read_warn_details (char const *name, off_t offset, size_t size, bool padding)
|
||||||
|
{
|
||||||
|
char buf[UINTMAX_STRSIZE_BOUND];
|
||||||
|
int e = errno;
|
||||||
|
- WARN ((0, e,
|
||||||
|
- ngettext ("%s: Warning: Read error at byte %s, while reading %lu byte",
|
||||||
|
- "%s: Warning: Read error at byte %s, while reading %lu bytes",
|
||||||
|
- size),
|
||||||
|
- quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
- (unsigned long) size));
|
||||||
|
+ if (padding)
|
||||||
|
+ WARN ((0, e,
|
||||||
|
+ ngettext ("%s: Warning: Read error at byte %s, while reading %lu byte; padding with zeros",
|
||||||
|
+ "%s: Warning: Read error at byte %s, while reading %lu bytes; padding with zeros",
|
||||||
|
+ size),
|
||||||
|
+ quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
+ (unsigned long) size));
|
||||||
|
+ else
|
||||||
|
+ WARN ((0, e,
|
||||||
|
+ ngettext ("%s: Warning: Read error at byte %s, while reading %lu byte",
|
||||||
|
+ "%s: Warning: Read error at byte %s, while reading %lu bytes",
|
||||||
|
+ size),
|
||||||
|
+ quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
|
||||||
|
+ (unsigned long) size));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
diff --git a/lib/paxlib.h b/lib/paxlib.h
|
||||||
|
index d4251d1..ccf826b 100644
|
||||||
|
--- a/lib/paxlib.h
|
||||||
|
+++ b/lib/paxlib.h
|
||||||
|
@@ -94,10 +94,10 @@ void open_error (char const *);
|
||||||
|
void open_fatal (char const *) __attribute__ ((noreturn));
|
||||||
|
void open_warn (char const *);
|
||||||
|
void read_error (char const *);
|
||||||
|
-void read_error_details (char const *, off_t, size_t);
|
||||||
|
+void read_error_details (char const *, off_t, size_t, bool);
|
||||||
|
void read_fatal (char const *) __attribute__ ((noreturn));
|
||||||
|
void read_fatal_details (char const *, off_t, size_t) __attribute__ ((noreturn));
|
||||||
|
-void read_warn_details (char const *, off_t, size_t);
|
||||||
|
+void read_warn_details (char const *, off_t, size_t, bool);
|
||||||
|
void readlink_error (char const *);
|
||||||
|
void readlink_warn (char const *);
|
||||||
|
void rmdir_error (char const *);
|
||||||
|
diff --git a/src/common.h b/src/common.h
|
||||||
|
index bbe167e..34a30ec 100644
|
||||||
|
--- a/src/common.h
|
||||||
|
+++ b/src/common.h
|
||||||
|
@@ -713,7 +713,7 @@ int chdir_count (void);
|
||||||
|
|
||||||
|
void close_diag (char const *name);
|
||||||
|
void open_diag (char const *name);
|
||||||
|
-void read_diag_details (char const *name, off_t offset, size_t size);
|
||||||
|
+void read_diag_details (char const *name, off_t offset, size_t size, bool padding);
|
||||||
|
void readlink_diag (char const *name);
|
||||||
|
void savedir_diag (char const *name);
|
||||||
|
void seek_diag_details (char const *name, off_t offset);
|
||||||
|
diff --git a/src/create.c b/src/create.c
|
||||||
|
index 712ee18..181f7d9 100644
|
||||||
|
--- a/src/create.c
|
||||||
|
+++ b/src/create.c
|
||||||
|
@@ -1090,7 +1090,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
|
||||||
|
if (count == SAFE_READ_ERROR)
|
||||||
|
{
|
||||||
|
read_diag_details (st->orig_file_name,
|
||||||
|
- st->stat.st_size - size_left, bufsize);
|
||||||
|
+ st->stat.st_size - size_left, bufsize, true);
|
||||||
|
pad_archive (size_left);
|
||||||
|
return dump_status_short;
|
||||||
|
}
|
||||||
|
diff --git a/src/misc.c b/src/misc.c
|
||||||
|
index eccf6f9..28c6f44 100644
|
||||||
|
--- a/src/misc.c
|
||||||
|
+++ b/src/misc.c
|
||||||
|
@@ -1069,15 +1069,15 @@ open_diag (char const *name)
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
-read_diag_details (char const *name, off_t offset, size_t size)
|
||||||
|
+read_diag_details (char const *name, off_t offset, size_t size, bool padding)
|
||||||
|
{
|
||||||
|
if (ignore_failed_read_option)
|
||||||
|
{
|
||||||
|
if (WARNING_ENABLED(WARN_FAILED_READ))
|
||||||
|
- read_warn_details (name, offset, size);
|
||||||
|
+ read_warn_details (name, offset, size, padding);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
- read_error_details (name, offset, size);
|
||||||
|
+ read_error_details (name, offset, size, padding);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
diff -rup tar-1.34/src/sparse.c.old tar-1.34/src/sparse.c
|
||||||
|
--- tar-1.34/src/sparse.c.old 2022-06-27 09:15:48.580574517 +0000
|
||||||
|
+++ tar-1.34/src/sparse.c 2022-06-27 09:18:28.500574517 +0000
|
||||||
|
@@ -424,7 +424,7 @@ sparse_dump_region (struct tar_sparse_fi
|
||||||
|
(file->stat_info->sparse_map[i].offset
|
||||||
|
+ file->stat_info->sparse_map[i].numbytes
|
||||||
|
- bytes_left),
|
||||||
|
- bufsize);
|
||||||
|
+ bufsize, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (bytes_read == 0)
|
||||||
|
@@ -619,7 +619,7 @@ check_sparse_region (struct tar_sparse_f
|
||||||
|
{
|
||||||
|
read_diag_details (file->stat_info->orig_file_name,
|
||||||
|
beg,
|
||||||
|
- rdsize);
|
||||||
|
+ rdsize, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (bytes_read == 0)
|
||||||
|
@@ -674,7 +674,7 @@ check_data_region (struct tar_sparse_fil
|
||||||
|
(file->stat_info->sparse_map[i].offset
|
||||||
|
+ file->stat_info->sparse_map[i].numbytes
|
||||||
|
- size_left),
|
||||||
|
- rdsize);
|
||||||
|
+ rdsize, false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (bytes_read == 0)
|
@ -0,0 +1,30 @@
|
|||||||
|
From 3da78400eafcccb97e2f2fd4b227ea40d794ede8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sergey Poznyakoff <gray@gnu.org>
|
||||||
|
Date: Sat, 11 Feb 2023 11:57:39 +0200
|
||||||
|
Subject: [PATCH] Fix boundary checking in base-256 decoder
|
||||||
|
|
||||||
|
* src/list.c (from_header): Base-256 encoding is at least 2 bytes
|
||||||
|
long.
|
||||||
|
---
|
||||||
|
src/list.c | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/list.c b/src/list.c
|
||||||
|
index 9fafc425..86bcfdd1 100644
|
||||||
|
--- a/src/list.c
|
||||||
|
+++ b/src/list.c
|
||||||
|
@@ -881,8 +881,9 @@ from_header (char const *where0, size_t digs, char const *type,
|
||||||
|
where++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- else if (*where == '\200' /* positive base-256 */
|
||||||
|
- || *where == '\377' /* negative base-256 */)
|
||||||
|
+ else if (where <= lim - 2
|
||||||
|
+ && (*where == '\200' /* positive base-256 */
|
||||||
|
+ || *where == '\377' /* negative base-256 */))
|
||||||
|
{
|
||||||
|
/* Parse base-256 output. A nonnegative number N is
|
||||||
|
represented as (256**DIGS)/2 + N; a negative number -N is
|
||||||
|
--
|
||||||
|
2.38.1
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
Version: GnuPG v1
|
||||||
|
|
||||||
|
iEYEABECAAYFAmAnuBMACgkQNgKwf1XQxzJIVgCfR5Z7coRkU2+aOW4KNhumGl/1
|
||||||
|
jn4AoI9OuQPpyzZN1CIwejDYxbV7u59P
|
||||||
|
=mfma
|
||||||
|
-----END PGP SIGNATURE-----
|
@ -1,156 +0,0 @@
|
|||||||
From 7fac753fb6e6c0459788ee9015b984dba1de5402 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lukas Javorsky <ljavorsk@redhat.com>
|
|
||||||
Date: Tue, 18 Jul 2023 14:10:12 +0000
|
|
||||||
Subject: [PATCH] Add exclude17 and exclude18 tests which were forgotten by
|
|
||||||
upstream
|
|
||||||
|
|
||||||
Sources:
|
|
||||||
*https://git.savannah.gnu.org/cgit/tar.git/tree/tests/exclude17.at
|
|
||||||
*https://git.savannah.gnu.org/cgit/tar.git/tree/tests/exclude18.at
|
|
||||||
|
|
||||||
Repoted to upstream in ML:
|
|
||||||
*https://lists.gnu.org/archive/html/bug-tar/2023-07/msg00002.html
|
|
||||||
---
|
|
||||||
tests/exclude17.at | 35 +++++++++++++++++++
|
|
||||||
tests/exclude18.at | 87 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
2 files changed, 122 insertions(+)
|
|
||||||
create mode 100644 tests/exclude17.at
|
|
||||||
create mode 100644 tests/exclude18.at
|
|
||||||
|
|
||||||
diff --git a/tests/exclude17.at b/tests/exclude17.at
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..5539ef3
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/exclude17.at
|
|
||||||
@@ -0,0 +1,35 @@
|
|
||||||
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
||||||
+#
|
|
||||||
+# Test suite for GNU tar.
|
|
||||||
+# Copyright 2013-2023 Free Software Foundation, Inc.
|
|
||||||
+
|
|
||||||
+# This file is part of GNU tar.
|
|
||||||
+
|
|
||||||
+# GNU tar 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 3 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+
|
|
||||||
+# GNU tar 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
+
|
|
||||||
+AT_SETUP([--exclude-vcs-ignores memory allocation])
|
|
||||||
+AT_KEYWORDS([exclude exclude17])
|
|
||||||
+
|
|
||||||
+AT_TAR_CHECK([
|
|
||||||
+mkdir dir
|
|
||||||
+cd dir
|
|
||||||
+echo '*.o' >.cvsignore
|
|
||||||
+tar -cf - --exclude-vcs-ignores . | tar -tf -
|
|
||||||
+],
|
|
||||||
+[0],
|
|
||||||
+[./
|
|
||||||
+./.cvsignore
|
|
||||||
+])
|
|
||||||
+
|
|
||||||
+AT_CLEANUP
|
|
||||||
diff --git a/tests/exclude18.at b/tests/exclude18.at
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..64aaa52
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/exclude18.at
|
|
||||||
@@ -0,0 +1,87 @@
|
|
||||||
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
||||||
+
|
|
||||||
+# Test suite for GNU tar.
|
|
||||||
+# Copyright 2004-2023 Free Software Foundation, Inc.
|
|
||||||
+
|
|
||||||
+# This file is part of GNU tar.
|
|
||||||
+
|
|
||||||
+# GNU tar 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 3 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+
|
|
||||||
+# GNU tar 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
+
|
|
||||||
+# Test --exclude-vcs option with subcommands: EXTRACT, LIST, DIFF.
|
|
||||||
+# Check VCS directory with files, and empty.
|
|
||||||
+#
|
|
||||||
+# Ref: https://savannah.gnu.org/bugs/?62859
|
|
||||||
+# Wed 03 Aug 2022 04:06:28 PM UTC, original submission: Quote
|
|
||||||
+# Mohamed Akram <mohdakram>
|
|
||||||
+# > The --exclude-vcs flag seems to exclude .gitignore but not .git when
|
|
||||||
+# extracting.
|
|
||||||
+
|
|
||||||
+AT_SETUP([--exclude-vcs extract list compare])
|
|
||||||
+AT_KEYWORDS([exclude-vcs extract list compare exclude18])
|
|
||||||
+
|
|
||||||
+AT_TAR_CHECK([
|
|
||||||
+AT_SORT_PREREQ
|
|
||||||
+mkdir gitrepo
|
|
||||||
+cd gitrepo
|
|
||||||
+
|
|
||||||
+# Make an empty VCS directory:
|
|
||||||
+mkdir .svn
|
|
||||||
+
|
|
||||||
+# Make a VCS directory with a file:
|
|
||||||
+mkdir .git
|
|
||||||
+touch .git/_A
|
|
||||||
+
|
|
||||||
+# Make a VCS file:
|
|
||||||
+touch .gitignore
|
|
||||||
+
|
|
||||||
+# Make non-VCS files:
|
|
||||||
+touch .git_B
|
|
||||||
+touch _C
|
|
||||||
+
|
|
||||||
+# Create an archive, include VCS:
|
|
||||||
+cd ..
|
|
||||||
+tar -cf gitrepo.tar gitrepo
|
|
||||||
+rm -r gitrepo
|
|
||||||
+
|
|
||||||
+echo Extract:
|
|
||||||
+tar -xvf gitrepo.tar --exclude-vcs | sort
|
|
||||||
+
|
|
||||||
+echo
|
|
||||||
+echo List:
|
|
||||||
+tar -tf gitrepo.tar --exclude-vcs | sort
|
|
||||||
+
|
|
||||||
+echo
|
|
||||||
+echo Diff:
|
|
||||||
+tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort
|
|
||||||
+
|
|
||||||
+],
|
|
||||||
+[0],
|
|
||||||
+[Extract:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+
|
|
||||||
+List:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+
|
|
||||||
+Diff:
|
|
||||||
+gitrepo/
|
|
||||||
+gitrepo/.git_B
|
|
||||||
+gitrepo/_C
|
|
||||||
+],
|
|
||||||
+[])
|
|
||||||
+
|
|
||||||
+AT_CLEANUP
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
|||||||
From d437ecf75de2d6fdeb2aed6f45c4b3b16373389b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sergey Poznyakoff <gray@gnu.org>
|
|
||||||
Date: Fri, 11 Aug 2023 21:35:30 +0300
|
|
||||||
Subject: [PATCH] Revert "Fix savannah bug #63567"
|
|
||||||
|
|
||||||
Commit e89c7a45eb broke deletion from archives. The reported number
|
|
||||||
of bytes read is rounded to the nearest record anyway, revert the
|
|
||||||
commit and document the fact.
|
|
||||||
|
|
||||||
Reported by Ed Santiago. See
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=2230127
|
|
||||||
|
|
||||||
* doc/tar.texi: Document the fact that --totals rounds up the
|
|
||||||
number of bytes reads to the nearest record.
|
|
||||||
* src/buffer.c: Revert changes.
|
|
||||||
* tests/delete06.at: Fix expected status code and stderr.
|
|
||||||
---
|
|
||||||
doc/tar.texi | 5 +++++
|
|
||||||
src/buffer.c | 3 +--
|
|
||||||
tests/delete06.at | 7 +++++--
|
|
||||||
3 files changed, 11 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/doc/tar.texi b/doc/tar.texi
|
|
||||||
index d43b39e4..ee631137 100644
|
|
||||||
--- a/doc/tar.texi
|
|
||||||
+++ b/doc/tar.texi
|
|
||||||
@@ -4215,6 +4215,11 @@ Total bytes read: 7924664320 (7.4GiB, 95MiB/s)
|
|
||||||
@end group
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
+Notice, that since @command{tar} operates on @dfn{records}, the number
|
|
||||||
+of bytes reported can be rounded up to the nearest full record. This
|
|
||||||
+can happen, in particular, when the last record in the archive is
|
|
||||||
+partial. @xref{Blocking}.
|
|
||||||
+
|
|
||||||
Finally, when deleting from an archive, the @option{--totals} option
|
|
||||||
displays both numbers plus number of bytes removed from the archive:
|
|
||||||
|
|
||||||
diff --git a/src/buffer.c b/src/buffer.c
|
|
||||||
index 12a0579f..8a575f9a 100644
|
|
||||||
--- a/src/buffer.c
|
|
||||||
+++ b/src/buffer.c
|
|
||||||
@@ -987,8 +987,7 @@ short_read (size_t status)
|
|
||||||
}
|
|
||||||
|
|
||||||
record_end = record_start + (record_size - left) / BLOCKSIZE;
|
|
||||||
- if (left == 0)
|
|
||||||
- records_read++;
|
|
||||||
+ records_read++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Flush the current buffer to/from the archive. */
|
|
||||||
diff --git a/tests/delete06.at b/tests/delete06.at
|
|
||||||
index 9668a28c..c84ba20e 100644
|
|
||||||
--- a/tests/delete06.at
|
|
||||||
+++ b/tests/delete06.at
|
|
||||||
@@ -36,7 +36,10 @@ esac
|
|
||||||
dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null
|
|
||||||
tar --delete 'b/' -f trunc.tar
|
|
||||||
],
|
|
||||||
-[0],
|
|
||||||
-[],[],[],[],[gnu, pax])
|
|
||||||
+[2],
|
|
||||||
+[],
|
|
||||||
+[tar: lseek: trunc.tar: Value too large for defined data type
|
|
||||||
+tar: Exiting with failure status due to previous errors
|
|
||||||
+],[],[],[gnu, pax])
|
|
||||||
|
|
||||||
AT_CLEANUP
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
Loading…
Reference in new issue