public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.918
@ 2022-02-17 17:26 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-02-17 17:26 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=7997da4b0966098288ee93fcd3673d86e7a1e5e5

commit 7997da4b0966098288ee93fcd3673d86e7a1e5e5
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Feb 10 16:59:39 2022 +0000

    Make '--package-manager' imply 'download and install packages'
    
    Refine 147fc15d
    
    Imply both '-D' and '-L' with '-M', as well as '-q' (so that mode gets
    definite behaviour rather than 'whatever you chose last time' as well).
    
    Tweak help text for '-D' and '-L' to make more sense when they are used
    in combination.

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=2d365d75a91d6834b44c21def409fff1f9fb0199

commit 2d365d75a91d6834b44c21def409fff1f9fb0199
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Feb 10 15:38:56 2022 +0000

    Handle tar type flag 'K' (GNU long link extension)
    
    Handle tar type flag'K' (GNU long link extension)
    Also report unexpected filename in headers with long name extension type
    Also clean up some cruft in archive_tar.cc
    
    Currently, the only existing package which contains type flag 'K'
    entries is f21-backgrounds-extras.
    
    This also now correctly handles tar archive header linknames of exactly
    100 characters (even when not preceeded by a 'K' type header), where the
    linkname field is not null terminated as it should be, rather than
    allowing the 'ustar\0' magic immediately following it to be interpreted
    as part of the linkname.

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=d014df0a09ac0acdf72be5cb52e2b13dcadfb758

commit d014df0a09ac0acdf72be5cb52e2b13dcadfb758
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Feb 7 14:52:26 2022 +0000

    Show overall progress for checking packages in package cache
    
    Show overall progress for testing presence and validating packages in
    package cache.
    
    This gives a better sense of progress when installing many packages
    which are already cached (e.g. a fresh install, but all required
    packagea are already in the package cache, so this step, rather than the
    download one, dominates).

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=d4e40cf8c0ba44b4f07878d26add3c1cc0374907

commit d4e40cf8c0ba44b4f07878d26add3c1cc0374907
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Feb 7 11:25:09 2022 +0000

    Clear download progress/rate text after download
    
    Don't leave download progress/rate text displayed while we compute the
    hash of the file we've just downloaded.

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=b2ab891507d9850816cc61000329853fdaf1c183

commit b2ab891507d9850816cc61000329853fdaf1c183
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Feb 7 12:57:39 2022 +0000

    Downgrade some xz compression debug output
    
    This not very helpful output goes to verbose log for every decompressed archive.


Diff:
---
 archive_tar.cc | 62 +++++++++++++++++++++++++++++++++++++---------------------
 archive_tar.h  |  2 ++
 compress_xz.cc |  6 ++++--
 download.cc    |  1 +
 geturl.cc      |  1 +
 source.cc      |  6 +++---
 6 files changed, 51 insertions(+), 27 deletions(-)

diff --git a/archive_tar.cc b/archive_tar.cc
index 5b2a7719..63269a61 100644
--- a/archive_tar.cc
+++ b/archive_tar.cc
@@ -21,9 +21,7 @@
 #include <sys/fcntl.h>
 #include <errno.h>
 
-//#include "zlib/zlib.h"
 #include "io_stream.h"
-//#include "compress.h"
 #include "win32.h"
 #include "archive.h"
 #include "archive_tar.h"
@@ -31,14 +29,7 @@
 #include "LogFile.h"
 #include "filemanip.h"
 
-#if 0
-#undef _WIN32
-#include "bzlib.h"
-
-#define SYMLINK_COOKIE "!<symlink>"
-#endif
 static int err;
-
 static char buf[512];
 
 int _tar_verbose = 0;
@@ -154,13 +145,26 @@ archive_tar::next_file_name ()
   if (n == 0)
     return std::string();
 
-  if (!state.have_longname && state.tar_header.typeflag != 'L')
+  if (!state.have_longname)
     {
       memcpy (state.filename, state.tar_header.name, 100);
       state.filename[100] = 0;
     }
-  else if (state.have_longname)
-    state.have_longname = 0;
+
+  if (!state.have_longlink)
+    {
+      memcpy (state.linkname, state.tar_header.linkname, 100);
+      state.linkname[100] = 0;
+    }
+
+  /* typeflag for any 'real' file consumes the longname/longlink state from
+     previous blocks */
+  if ((state.tar_header.typeflag != 'K') &&
+      (state.tar_header.typeflag != 'L'))
+    {
+      state.have_longname = 0;
+      state.have_longlink = 0;
+    }
 
   sscanf (state.tar_header.size, "%zo", &state.file_length);
   state.file_offset = 0;
@@ -171,9 +175,13 @@ archive_tar::next_file_name ()
 
   switch (state.tar_header.typeflag)
     {
+    case 'K':			/* GNU tar long link extension */
     case 'L':			/* GNU tar long name extension */
-      /* we read the 'file' into the long filename, then call back into here
-       * to find out if the actual file is a real file, or a special file..
+      if (strcmp(state.tar_header.name, "././@LongLink") != 0)
+        LogBabblePrintf("tar: unexpected filename %s in file type %c header\n", state.tar_header.name, state.tar_header.typeflag);
+
+      /* we read the 'file' into the long filename/linkname, then recursively
+       * call ourselves to handle the following block.
        */
       if (state.file_length > CYG_PATH_MAX)
 	{
@@ -187,7 +195,18 @@ archive_tar::next_file_name ()
 	  skip_file ();
 	  return next_file_name ();
 	}
-      c = state.filename;
+
+      if (state.tar_header.typeflag == 'L')
+        {
+          c = state.filename;
+          state.have_longname = 1;
+        }
+      else
+        {
+          c = state.linkname;
+          state.have_longlink = 1;
+        }
+
       /* FIXME: this should be a single read() call */
       while (state.file_length > state.file_offset)
 	{
@@ -195,17 +214,16 @@ archive_tar::next_file_name ()
 	    state.file_length - state.file_offset >
 	    512 ? 512 : state.file_length - state.file_offset;
 	  if (state.parent->read (buf, 512) < 512)
-	    // FIXME: What's up with the "0"? It's probably a mistake, and
-	    // should be "". It used to be written as 0, and was subject to a
-	    // bizarre implicit conversion by the unwise String(int)
-	    // constructor.
-	    return "0";
+            {
+              LogPlainPrintf( "error: error reading long name\n");
+              return "";
+            }
 	  memcpy (c, buf, need);
 	  c += need;
 	  state.file_offset += need;
 	}
       *c = 0;
-      state.have_longname = 1;
+
       return next_file_name ();
 
     case '3':			/* char */
@@ -297,7 +315,7 @@ archive_tar::linktarget ()
   /* TODO: consider .. path traversal issues */
   if (next_file_type () == ARCHIVE_FILE_SYMLINK ||
       next_file_type () == ARCHIVE_FILE_HARDLINK)
-    return state.tar_header.linkname;
+    return state.linkname;
   return std::string();
 }
 
diff --git a/archive_tar.h b/archive_tar.h
index cc0a46c2..3adc0560 100644
--- a/archive_tar.h
+++ b/archive_tar.h
@@ -66,12 +66,14 @@ public:
   int lasterr;
   int eocf;
   char have_longname;
+  bool have_longlink;
   /* where in the current file are we? */
   size_t file_offset;
   size_t file_length;
   int header_read;
   tar_header_type tar_header;
   char filename[CYG_PATH_MAX + 512];
+  char linkname[CYG_PATH_MAX + 512];
   tar_map_result_type *tar_map_result;
 };
 
diff --git a/compress_xz.cc b/compress_xz.cc
index bb645950..d3f4886c 100644
--- a/compress_xz.cc
+++ b/compress_xz.cc
@@ -524,7 +524,9 @@ compress_xz::bid_xz (void * buffer, size_t len)
     return 0;
   bits_checked += 8;
 
+#ifdef DEBUG
   LogBabblePrintf ("compress_xz::bid_xz: success: %d\n", bits_checked);
+#endif
   return (bits_checked);
 }
 
@@ -632,8 +634,8 @@ compress_xz::bid_lzma (void * buffer, size_t len)
 
   /* TODO: The above test is still very weak.  It would be
    * good to do better. */
+#ifdef DEBUG
   LogBabblePrintf ("compress_xz::bid_lzma: success: %d\n", bits_checked);
+#endif
   return (bits_checked);
 }
-
-
diff --git a/download.cc b/download.cc
index fd1253b9..5bfcebf0 100644
--- a/download.cc
+++ b/download.cc
@@ -305,6 +305,7 @@ do_download_thread (HINSTANCE h, HWND owner)
           // Unexpected exception.
           throw e;
         }
+      Progress.SetBar2(std::distance(t.begin(), i) + 1, t.size());
     }
 
   /* and do the download. FIXME: This here we assign a new name for the cached version
diff --git a/geturl.cc b/geturl.cc
index e82cb16b..679e4688 100644
--- a/geturl.cc
+++ b/geturl.cc
@@ -256,6 +256,7 @@ get_url_to_file (const std::string &_url,
       int df = diskfull (get_root_dir ().c_str());
 	  Progress.SetBar3(df);
     }
+  Progress.SetText3("");
 
   return 0;
 }
diff --git a/source.cc b/source.cc
index 6aca7f5c..066da8de 100644
--- a/source.cc
+++ b/source.cc
@@ -33,8 +33,8 @@
 
 #include "getopt++/BoolOption.h"
 
-static BoolOption DownloadOption (false, 'D', "download", "Download packages from internet only");
-static BoolOption LocalOption (false, 'L', "local-install", "Install packages from local directory only");
+static BoolOption DownloadOption (false, 'D', "download", "Download packages from internet");
+static BoolOption LocalOption (false, 'L', "local-install", "Install packages from local directory");
 
 static int rb[] =
   { IDC_SOURCE_NETINST, IDC_SOURCE_DOWNLOAD, IDC_SOURCE_LOCALDIR, 0 };
@@ -91,7 +91,7 @@ SourcePage::OnActivate ()
     source = IDC_SOURCE_DOWNLOAD;
   else if (LocalOption)
     source = IDC_SOURCE_LOCALDIR;
-  else if ((unattended_mode == unattended) || (!source))
+  else if ((unattended_mode != attended) || (!source))
     // default to IDC_SOURCE_NETINST if unattended, or source not already set
     // (i.e. first run)
     source = IDC_SOURCE_NETINST;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-17 17:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 17:26 [setup - the official Cygwin setup program] branch master, updated. release_2.918 Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).