rpms/tar/F-9 tar-1.19-newfilearchiveerror.patch, NONE, 1.1 tar.spec, 1.69, 1.70
Ondrej Vasik (ovasik)
fedora-extras-commits at redhat.com
Mon Jun 16 10:59:12 UTC 2008
Author: ovasik
Update of /cvs/extras/rpms/tar/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2788
Modified Files:
tar.spec
Added Files:
tar-1.19-newfilearchiveerror.patch
Log Message:
do not print invalid tar archive error when creating archives (#451288)
tar-1.19-newfilearchiveerror.patch:
--- NEW FILE tar-1.19-newfilearchiveerror.patch ---
diff -urNp tar-1.19-orig/src/buffer.c tar-1.19/src/buffer.c
--- tar-1.19-orig/src/buffer.c 2007-08-26 10:56:55.000000000 +0200
+++ tar-1.19/src/buffer.c 2008-06-16 12:42:35.000000000 +0200
@@ -230,19 +230,21 @@ static struct zip_magic const magic[] =
/* Check if the file ARCHIVE is a compressed archive. */
enum compress_type
-check_compressed_archive ()
+check_compressed_archive (bool *pshort)
{
struct zip_magic const *p;
bool sfr;
- bool short_file = false;
+ bool temp;
+
+ if (!pshort)
+ pshort = &temp;
/* Prepare global data needed for find_next_block: */
record_end = record_start; /* set up for 1st record = # 0 */
sfr = read_full_records;
read_full_records = true; /* Suppress fatal error on reading a partial
record */
- if (find_next_block () == 0)
- short_file = true;
+ *pshort = find_next_block () == 0;
/* Restore global values */
read_full_records = sfr;
@@ -255,9 +257,6 @@ check_compressed_archive ()
if (memcmp (record_start->buffer, p->magic, p->length) == 0)
return p->type;
- if (short_file)
- ERROR ((0, 0, _("This does not look like a tar archive")));
-
return ct_none;
}
@@ -274,10 +273,15 @@ open_compressed_archive ()
if (!multi_volume_option)
{
- enum compress_type type = check_compressed_archive ();
+ bool shortfile;
+ enum compress_type type = check_compressed_archive (&shortfile);
- if (type == ct_none)
- return archive;
+ if (type == ct_none)
+ {
+ if (shortfile)
+ ERROR ((0, 0, _("This does not look like a tar archive")));
+ return archive;
+ }
/* FD is not needed any more */
rmtclose (archive);
@@ -503,15 +507,18 @@ _open_archive (enum access_mode wanted_a
{
case ACCESS_READ:
{
+ bool shortfile;
enum compress_type type;
archive = STDIN_FILENO;
- type = check_compressed_archive ();
+ type = check_compressed_archive (&shortfile);
if (type != ct_none)
FATAL_ERROR ((0, 0,
_("Archive is compressed. Use %s option"),
compress_option (type)));
+ if (shortfile)
+ ERROR ((0, 0, _("This does not look like a tar archive")));
}
break;
@@ -555,7 +562,7 @@ _open_archive (enum access_mode wanted_a
O_RDWR | O_CREAT | O_BINARY,
MODE_RW, rsh_command_option);
- if (check_compressed_archive () != ct_none)
+ if (check_compressed_archive (NULL) != ct_none)
FATAL_ERROR ((0, 0,
_("Cannot update compressed archives")));
break;
Index: tar.spec
===================================================================
RCS file: /cvs/extras/rpms/tar/F-9/tar.spec,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- tar.spec 13 Feb 2008 16:20:29 -0000 1.69
+++ tar.spec 16 Jun 2008 10:58:24 -0000 1.70
@@ -2,7 +2,7 @@
Name: tar
Epoch: 2
Version: 1.19
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv3+
Group: Applications/Archiving
URL: http://www.gnu.org/software/tar/
@@ -15,6 +15,7 @@
Patch4: tar-1.19-xattrs-conf.patch
Patch5: tar-1.17-wildcards.patch
Patch6: tar-1.19-gcc43.patch
+Patch7: tar-1.19-newfilearchiveerror.patch
Prereq: info
BuildRequires: autoconf automake gzip texinfo gettext libacl-devel libselinux-devel gawk
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -41,6 +42,7 @@
%patch4 -p1 -b .xattrs-conf
%patch5 -p1 -b .wildcards
%patch6 -p1 -b .gcc43
+%patch7 -p1 -b .emptyarch
%build
%configure --bindir=/bin --libexecdir=/sbin
@@ -91,6 +93,10 @@
%{_infodir}/tar.info*
%changelog
+* Mon Jun 16 2008 Ondrej Vasik <ovasik at redhat.com> 2:1.19-4
+- do not print invalid tar archive error when creating archives
+ (#451288)
+
* Tue Feb 12 2008 Radek Brich <rbrich at redhat.com> 2:1.19-3
- do not print getfilecon/setfilecon warnings when SELinux is disabled
or SELinux data are not available (bz#431879)
More information about the fedora-extras-commits
mailing list