setup.exe: Invalid or unsupported tar format

Thrall, Bryan
Mon May 5 20:24:00 GMT 2008

I've built setup.exe from source (updated today), and the ChangeLog says
Brian Dessent fixed the "Invalid or unsupported tar format" problem with
empty tar.bz2 files, but I am still seeing the error popup.

I have an empty meta-package to pull in other packages copied from one
of the _obsolete packages. I understand these are created via 'tar -T
/dev/null -cjf foo.tar.bz2' (see, and diff
reports the results identical; the file size is the expected 46 bytes.

The setup.exe source (, Installer::installOne) looks like it
expects an error peeking from try_decompress in this situation, but
running in the debugger shows try_decompress->peek() successfully
reading '0'. Note that if you bunzip2 the empty package, you get a 10K
tarball which is all zeroes, so success isn't completely unexpected...

$ cygcheck -cd | grep 'bzip\|tar\|cygwin'
bzip2                   1.0.3-2
cygwin                  1.5.25-7
mingw-bzip2             1.0.3-2
tar                     1.19-1

Am I missing anything? I'm not sure the best way to fix this; the
following patch worked, but seems unlikely to actually be correct in all

Is an empty tarball the only case where the peek value will be zero?

RCS file: /cvs/cygwin-apps/setup/,v
retrieving revision 2.83
diff -u -p -w -r2.83
---  9 Apr 2008 02:25:27 -0000       2.83
+++  5 May 2008 20:15:13 -0000
@@ -259,7 +259,7 @@ Installer::installOne (packagemeta &pkgm
           /* Decompression succeeded but we couldn't grok it as a valid
              archive.  */
           char c;
-          if (try_decompress->peek (&c, 1) < 0)
+          if (try_decompress->peek (&c, 1) < 0 || !c) // assume 0
indicates empty tarball
             /* In some cases, maintainers have uploaded bzipped
                0-byte files as dummy packages instead of empty tar
                This is common enough that we should not treat this as

Bryan Thrall
FlightSafety International 

More information about the Cygwin-apps mailing list