]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* CHANGES: Update.
authorBrian Dessent <brian@dessent.net>
Wed, 9 Apr 2008 02:25:27 +0000 (02:25 +0000)
committerBrian Dessent <brian@dessent.net>
Wed, 9 Apr 2008 02:25:27 +0000 (02:25 +0000)
* install.cc (Installer::installOne): Cope with compressed
0-byte dummy packages.  Fix progress bar update bug introduced
in earlier refactoring.

CHANGES
ChangeLog
install.cc

diff --git a/CHANGES b/CHANGES
index f58742a2409b80a136f33f9851517873a670cf6e..a91f0086d15e8a60137bd1bf4dc650a2d50b3b31 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,9 @@ Note: For easier maintenance try to keep items in reverse chronological
 
 Version HEAD
 
+ - Don't treat dummy packages consisting of compressed 0-byte files as
+   invalid.
+
  - Avoid crashing on invalid/empty .lst.gz file.  Make "files in use"
    dialog modal to prevent the user from aborting the install and creating
    a corrupt .lst.gz.
index e92fbadb886f9a7521d2a903d87a843cc0a60308..333ea5152a3ddb1dfb0ea979d80dc008942c0858 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-08  Brian Dessent  <brian@dessent.net>
+
+       * CHANGES: Update.
+       * install.cc (Installer::installOne): Cope with compressed
+       0-byte dummy packages.  Fix progress bar update bug introduced
+       in earlier refactoring.
+
 2008-04-08  Brian Dessent  <brian@dessent.net>
 
        * CHANGES: Update.
index ca57c5e1ceed096e4b70ff5d7e692fbfb6285a0a..345629d3cc1d70a3391dfe010b163a2fd61bb093 100644 (file)
@@ -257,11 +257,21 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver,
       if ((tarstream = archive::extract (try_decompress)) == NULL)
         {
           /* Decompression succeeded but we couldn't grok it as a valid tar
-             archive, so notify the user and abort processing this package.  */
+             archive.  */
+          char c;
+          if (try_decompress->peek (&c, 1) < 0)
+            /* In some cases, maintainers have uploaded bzipped
+               0-byte files as dummy packages instead of empty tar files.
+               This is common enough that we should not treat this as an
+               error condition.  */
+            ;
+          else
+            {
+              note (NULL, IDS_ERR_OPEN_READ, source.Cached (),
+                    "Invalid or unsupported tar format");
+              ++errors;
+            }
           delete try_decompress;
-          note (NULL, IDS_ERR_OPEN_READ, source.Cached (),
-                "Invalid or unsupported tar format");
-          ++errors;
           return;
         }
     }
@@ -408,7 +418,7 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver,
           // We're done with this file
           break;
         }
-      progress (tarstream->tell ());
+      progress (pkgfile->tell ());
       num_installs++;
     }
 
This page took 0.041972 seconds and 5 git commands to generate.