Re: bsdtar / libarchive bug?

2005-12-09 Thread Steven Hartland
- Original Message - 
From: Brian Fundakowski Feldman [EMAIL PROTECTED]

I don't think it will happily create empty tar.gz files, even where
by empty you mean the tar itself inside of the gz.

{/home/green [EMAIL PROTECTED] tar cfv x.tar
tar: no files or directories specified
{/home/green [EMAIL PROTECTED] tar cfvz x.tar.gz
tar: no files or directories specified
{/home/green [EMAIL PROTECTED] ls -l x.ta*
ls: x.ta*: No such file or directory


Try this instead which is how I managed it ( not on purpose )
touch test.files
tar --files-from test.files -czf blank.tar.gz

Then to trigger the bug:
tar -xvzf blank.tar.gz

   Steve



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone (023) 8024 3137
or return the E.mail to [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bsdtar / libarchive bug?

2005-12-09 Thread Steven Hartland


- Original Message - 
From: Dan Nelson [EMAIL PROTECTED]



I managed to make it create 0-byte files:

$ touch a
$ tar cvf b.tar --exclude a a
$ tar zcvf b.tar.gz --exclude a a
$ ls -la b.tar*
-rw-r--r--  1 dan  wheel   0 Dec  8 17:37 b.tar
-rw-r--r--  1 dan  wheel  20 Dec  8 17:37 b.tar.gz
$ gunzip -vl b.tar.gz
method  crc date  time  compressed  uncompr. ratio uncompressed_name
defla  Dec  8 17:3720 0   0.0% b.tar

This works because at the time tar creates the output file, it doesn't
know that I have excluded all the listed files.

I am leaning towards an empty archive being legal, though, since it
makes scripting easier.  There may be cases where you are archiving
files generated daily, and you want to distinguish no data today from
the archiver didn't run.  At worst it should print a warning.


That's the reason here as well. It was a scripted process where we
create a tar.gz of new / changed files and a shell script to remove
old files. As some files had been removed only in this instance we
ended up with a script file with entries but nothing in the tar.gz which
then barfed on install.

   Steve



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone (023) 8024 3137
or return the E.mail to [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bsdtar / libarchive bug?

2005-12-09 Thread Steven Hartland
- Original Message - 
From: Brian Fundakowski Feldman [EMAIL PROTECTED]



Just don't let it accept a 0-length gzip.


That wont work as the gzip file does have length ( 20 bytes )
where as the resulting tar file doesn't ( 0 bytes )

   Steve



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone (023) 8024 3137
or return the E.mail to [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


bsdtar / libarchive bug?

2005-12-08 Thread Steven Hartland

It seems bsdtar can create files it cant read. i.e. it will happily create
empty tar.gz files but when it comes to read them the following error
is output:
tar: Unrecognized archive format: Inappropriate file type or format

Having a look at libarchive shows the following code:
   /* An empty archive is a serious error. */
   if (bytes_read == 0) {
   archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
   Empty input file);
   return (ARCHIVE_FATAL);
   }

Which is where I expect the issue is, why would an empty archive
be fatal? I can see any reason for this, yes its strange but there's
nothing fatal about it imo.

   Steve



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone (023) 8024 3137
or return the E.mail to [EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bsdtar / libarchive bug?

2005-12-08 Thread Brian Fundakowski Feldman
On Thu, Dec 08, 2005 at 05:29:06PM -, Steven Hartland wrote:
 It seems bsdtar can create files it cant read. i.e. it will happily create
 empty tar.gz files but when it comes to read them the following error
 is output:
 tar: Unrecognized archive format: Inappropriate file type or format
 
 Having a look at libarchive shows the following code:
/* An empty archive is a serious error. */
if (bytes_read == 0) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
Empty input file);
return (ARCHIVE_FATAL);
}
 
 Which is where I expect the issue is, why would an empty archive
 be fatal? I can see any reason for this, yes its strange but there's
 nothing fatal about it imo.

I don't think it will happily create empty tar.gz files, even where
by empty you mean the tar itself inside of the gz.

{/home/green [EMAIL PROTECTED] tar cfv x.tar
tar: no files or directories specified
{/home/green [EMAIL PROTECTED] tar cfvz x.tar.gz
tar: no files or directories specified
{/home/green [EMAIL PROTECTED] ls -l x.ta*
ls: x.ta*: No such file or directory

-- 
Brian Fundakowski Feldman   \'[ FreeBSD ]''\
   [EMAIL PROTECTED]   \  The Power to Serve! \
 Opinions expressed are my own.   \,,\
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bsdtar / libarchive bug?

2005-12-08 Thread Dan Nelson
In the last episode (Dec 08), Brian Fundakowski Feldman said:
 On Thu, Dec 08, 2005 at 05:29:06PM -, Steven Hartland wrote:
  It seems bsdtar can create files it cant read. i.e. it will happily create
  empty tar.gz files but when it comes to read them the following error
  is output:
  tar: Unrecognized archive format: Inappropriate file type or format
  
  Having a look at libarchive shows the following code:
 /* An empty archive is a serious error. */
 if (bytes_read == 0) {
 archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
 Empty input file);
 return (ARCHIVE_FATAL);
 }
  
  Which is where I expect the issue is, why would an empty archive
  be fatal? I can see any reason for this, yes its strange but there's
  nothing fatal about it imo.
 
 I don't think it will happily create empty tar.gz files, even where
 by empty you mean the tar itself inside of the gz.
 
 {/home/green [EMAIL PROTECTED] tar cfv x.tar
 tar: no files or directories specified
 {/home/green [EMAIL PROTECTED] tar cfvz x.tar.gz
 tar: no files or directories specified
 {/home/green [EMAIL PROTECTED] ls -l x.ta*
 ls: x.ta*: No such file or directory

I managed to make it create 0-byte files:

$ touch a
$ tar cvf b.tar --exclude a a
$ tar zcvf b.tar.gz --exclude a a
$ ls -la b.tar*
-rw-r--r--  1 dan  wheel   0 Dec  8 17:37 b.tar
-rw-r--r--  1 dan  wheel  20 Dec  8 17:37 b.tar.gz
$ gunzip -vl b.tar.gz
method  crc date  time  compressed  uncompr. ratio uncompressed_name
defla  Dec  8 17:3720 0   0.0% b.tar

This works because at the time tar creates the output file, it doesn't
know that I have excluded all the listed files.

I am leaning towards an empty archive being legal, though, since it
makes scripting easier.  There may be cases where you are archiving
files generated daily, and you want to distinguish no data today from
the archiver didn't run.  At worst it should print a warning.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bsdtar / libarchive bug?

2005-12-08 Thread Brian Fundakowski Feldman
On Thu, Dec 08, 2005 at 05:45:40PM -0600, Dan Nelson wrote:
 In the last episode (Dec 08), Brian Fundakowski Feldman said:
  On Thu, Dec 08, 2005 at 05:29:06PM -, Steven Hartland wrote:
   It seems bsdtar can create files it cant read. i.e. it will happily create
   empty tar.gz files but when it comes to read them the following error
   is output:
   tar: Unrecognized archive format: Inappropriate file type or format
   
   Having a look at libarchive shows the following code:
  /* An empty archive is a serious error. */
  if (bytes_read == 0) {
  archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  Empty input file);
  return (ARCHIVE_FATAL);
  }
   
   Which is where I expect the issue is, why would an empty archive
   be fatal? I can see any reason for this, yes its strange but there's
   nothing fatal about it imo.
  
  I don't think it will happily create empty tar.gz files, even where
  by empty you mean the tar itself inside of the gz.
  
  {/home/green [EMAIL PROTECTED] tar cfv x.tar
  tar: no files or directories specified
  {/home/green [EMAIL PROTECTED] tar cfvz x.tar.gz
  tar: no files or directories specified
  {/home/green [EMAIL PROTECTED] ls -l x.ta*
  ls: x.ta*: No such file or directory
 
 I managed to make it create 0-byte files:
 
 $ touch a
 $ tar cvf b.tar --exclude a a
 $ tar zcvf b.tar.gz --exclude a a
 $ ls -la b.tar*
 -rw-r--r--  1 dan  wheel   0 Dec  8 17:37 b.tar
 -rw-r--r--  1 dan  wheel  20 Dec  8 17:37 b.tar.gz
 $ gunzip -vl b.tar.gz
 method  crc date  time  compressed  uncompr. ratio uncompressed_name
 defla  Dec  8 17:3720 0   0.0% b.tar
 
 This works because at the time tar creates the output file, it doesn't
 know that I have excluded all the listed files.
 
 I am leaning towards an empty archive being legal, though, since it
 makes scripting easier.  There may be cases where you are archiving
 files generated daily, and you want to distinguish no data today from
 the archiver didn't run.  At worst it should print a warning.

Just don't let it accept a 0-length gzip.

-- 
Brian Fundakowski Feldman   \'[ FreeBSD ]''\
   [EMAIL PROTECTED]   \  The Power to Serve! \
 Opinions expressed are my own.   \,,\
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]