]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* res.rc: Add more error strings.
authorDJ Delorie <dj@redhat.com>
Thu, 12 Oct 2000 19:53:48 +0000 (19:53 +0000)
committerDJ Delorie <dj@redhat.com>
Thu, 12 Oct 2000 19:53:48 +0000 (19:53 +0000)
* resource.h: Ditto.
* iniparse.y (new_package): re-initialize if needed.
* download.cc (do_download): Keep track of errors; notify and
allow retry.
* install.cc (do_install): Ditto.

ChangeLog
download.cc
iniparse.y
install.cc
res.rc
resource.h

index 79e7e6b904c53889333e7fef38ef1fa20cd1b288..c3a0d3529e7662285f8a816aa488c57f2c19740e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-10-12  DJ Delorie  <dj@redhat.com>
+
+       * res.rc: Add more error strings.
+       * resource.h: Ditto.
+       * iniparse.y (new_package): re-initialize if needed.
+       * download.cc (do_download): Keep track of errors; notify and
+       allow retry.
+       * install.cc (do_install): Ditto.
+
 2000-10-05  DJ Delorie  <dj@redhat.com>
 
        * Makefile.in: fix %.cc rule
index ce1a34e39d4c80067b4e44833dc9ec2a8e064531..d5293fb336b1d2a4f4bb809f5c8b8e5563f0ea3c 100644 (file)
@@ -40,6 +40,7 @@ void
 do_download (HINSTANCE h)
 {
   int i;
+  int errors = 0;
 
   for (i=0; i<npackages; i++)
     if (package[i].action == ACTION_NEW || package[i].action == ACTION_UPGRADE)
@@ -57,8 +58,9 @@ do_download (HINSTANCE h)
                             concat (local, ".tmp", 0),
                             pi.install_size))
          {
-           log (0, "Download %s failed", local);
+           note (IDS_DOWNLOAD_FAILED, pi.install);
            package[i].action = ACTION_ERROR;
+           errors ++;
            continue;
          }
        else
@@ -74,15 +76,28 @@ do_download (HINSTANCE h)
                log (0, "Download %s wrong size (%d actual vs %d expected)", local, s.st_size, pi.install_size);
                note (IDS_DOWNLOAD_SHORT, local, s.st_size, pi.install_size);
                package[i].action = ACTION_ERROR;
+               errors ++;
              }
          }
       }
 
   dismiss_url_status_dialog ();
 
+  if (errors)
+    {
+      if (yesno (IDS_DOWNLOAD_INCOMPLETE) == IDYES)
+       {
+         next_dialog = IDD_SITE;
+         return;
+       }
+    }
+
   if (source == IDC_SOURCE_DOWNLOAD)
     {
-      exit_msg = IDS_DOWNLOAD_COMPLETE;
+      if (errors)
+       exit_msg = IDS_DOWNLOAD_INCOMPLETE;
+      else
+       exit_msg = IDS_DOWNLOAD_COMPLETE;
       next_dialog = 0;
     }
   else
index 82f5542369a41c51df956fa371d053307ce09f67..9b9246c4774d00d7a17ab712c3e7f337330ece6f 100644 (file)
@@ -102,6 +102,8 @@ static int maxpackages = 0;
 Package *
 new_package (char *name)
 {
+  if (package == 0)
+    maxpackages = npackages = 0;
   if (npackages >= maxpackages)
     {
       maxpackages += 10;
index cafd1e0d6d4cff6e0e8d011e7495b1cfacd04914..62e8ef2dbbf9ae00e000b2077c5dd0a7bb59176b 100644 (file)
@@ -242,6 +242,8 @@ void
 do_install (HINSTANCE h)
 {
   int i, num_installs = 0, num_uninstalls = 0;
+  int errors = 0;
+
   next_dialog = IDD_DESKTOP;
 
   mkdir_p (1, root_dir);
@@ -290,7 +292,10 @@ do_install (HINSTANCE h)
            {
              SetWindowText (ins_pkgname, package[i].name);
              SetWindowText (ins_action, "Uninstalling...");
-             log (0, "Uninstalling %s", package[i].name);
+             if (package[i].action == ACTION_UPGRADE)
+               log (0, "Uninstalling old %s", package[i].name);
+             else
+               log (0, "Uninstalling %s", package[i].name);
 
              while (gzgets (lst, line, sizeof (line)))
                {
@@ -339,6 +344,7 @@ do_install (HINSTANCE h)
            {
              package[i].action = ACTION_ERROR;
              note (IDS_ERR_OPEN_READ, local, "No such file");
+             errors ++;
              continue;
            }
 
@@ -372,7 +378,11 @@ do_install (HINSTANCE h)
              SetWindowText (ins_filename, dest_file);
              log (LOG_BABBLE, "Installing file %s", dest_file);
              if (tar_read_file (dest_file) != 0)
-               package[i].action = ACTION_ERROR;
+               {
+                 package[i].action = ACTION_ERROR;
+                 log (0, "Unable to install file %s", dest_file);
+                 errors ++;
+               }
 
              progress (tar_ftell ());
              num_installs ++;
@@ -480,5 +490,8 @@ do_install (HINSTANCE h)
   create_mount ("/usr/bin", concat (root_dir, "/bin", 0), istext, issystem);
   create_mount ("/usr/lib", concat (root_dir, "/lib", 0), istext, issystem);
 
-  exit_msg = IDS_INSTALL_COMPLETE;
+  if (errors)
+    exit_msg = IDS_INSTALL_INCOMPLETE;
+  else
+    exit_msg = IDS_INSTALL_COMPLETE;
 }
diff --git a/res.rc b/res.rc
index 471271add0c3368d6a65c60a961f34e2ad07f0e2..90695ba4771224e887631ec20538f86068b36891 100644 (file)
--- a/res.rc
+++ b/res.rc
@@ -367,6 +367,9 @@ BEGIN
     IDS_WININET             "Unable to find or load the Internet Explorer 5 DLLs"
     IDS_ERR_CHDIR           "Could not change dir to %s"
     IDS_OLD_SETUP_VERSION   "This setup is version %s, but setup.ini claims version %s is available.\nYou might want to upgrade to get the latest features and bug fixes."
+    IDS_DOWNLOAD_FAILED     "Unable to download %s"
+    IDS_DOWNLOAD_INCOMPLETE "Download Incomplete.  Try again?"
+    IDS_INSTALL_INCOMPLETE  "Installation incomplete.  Check /setup.log.full for details"
 END
 
 #endif    // English (U.S.) resources
index dd82a77420de01a4a86e3d34efde42c95347a4f9..c2ac1704eaba5a6b15557750b1f5efac6ac026dd 100644 (file)
@@ -24,6 +24,9 @@
 #define IDS_WININET                     22
 #define IDS_ERR_CHDIR                   23
 #define IDS_OLD_SETUP_VERSION           24
+#define IDS_DOWNLOAD_FAILED            25
+#define IDS_DOWNLOAD_INCOMPLETE                26
+#define IDS_INSTALL_INCOMPLETE         27
 #define IDD_ROOT                        101
 #define IDD_SOURCE                      102
 #define IDD_OTHER_URL                   103
This page took 0.040225 seconds and 5 git commands to generate.