]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* ini.h: add source actions cygwin-1-1-5
authorDJ Delorie <dj@redhat.com>
Mon, 23 Oct 2000 19:46:01 +0000 (19:46 +0000)
committerDJ Delorie <dj@redhat.com>
Mon, 23 Oct 2000 19:46:01 +0000 (19:46 +0000)
* fromcwd.cc: check for available sources
* res.rc: add checkbox bitmaps
* resource.h: ditto
* check-*.bmp: new
* choose.cc: add source column
* download.cc: download sources if called for
* install.cc: [un]install sources too

ChangeLog
check-na.bmp [new file with mode: 0644]
check-no.bmp [new file with mode: 0644]
check-yes.bmp [new file with mode: 0644]
choose.cc
download.cc
fromcwd.cc
ini.h
install.cc
res.rc
resource.h

index b179a07f2f189b22e738ad3f7f21f94e2fd495f3..0be6cb00bb8779a88e4995fdd640594ecb332bcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-10-23  DJ Delorie  <dj@redhat.com>
+
+       * ini.h: add source actions
+       * fromcwd.cc: check for available sources
+       * res.rc: add checkbox bitmaps
+       * resource.h: ditto
+       * check-*.bmp: new
+       * choose.cc: add source column
+       * download.cc: download sources if called for
+       * install.cc: [un]install sources too
+
 2000-10-22  DJ Delorie  <dj@redhat.com>
 
        * choose.cc (build_labels): Don't skip TRUST_PREV completely; only
diff --git a/check-na.bmp b/check-na.bmp
new file mode 100644 (file)
index 0000000..c139e54
Binary files /dev/null and b/check-na.bmp differ
diff --git a/check-no.bmp b/check-no.bmp
new file mode 100644 (file)
index 0000000..3639605
Binary files /dev/null and b/check-no.bmp differ
diff --git a/check-yes.bmp b/check-yes.bmp
new file mode 100644 (file)
index 0000000..f328dc2
Binary files /dev/null and b/check-yes.bmp differ
index a0a1bfff8ff6de569a137e09ee6c77d8a6ef7b36..059754013ba5a1fc4be119c648c2e638846aa5eb 100644 (file)
--- a/choose.cc
+++ b/choose.cc
@@ -41,9 +41,11 @@ static char *cvsid = "\n%%% $Id$\n";
 #include "log.h"
 #include "find.h"
 
-#define HMARGIN 10
-#define ROW_MARGIN 5
-#define ICON_MARGIN 4
+#define HMARGIN                10
+#define ROW_MARGIN     5
+#define ICON_MARGIN    4
+
+#define CHECK_SIZE     11
 
 #define TRUST_KEEP     101
 #define TRUST_UNINSTALL        102
@@ -60,7 +62,7 @@ static TEXTMETRIC tm;
 static int header_height;
 static HANDLE sysfont;
 static int row_height;
-static HANDLE bm_spin, bm_rtarrow;
+static HANDLE bm_spin, bm_rtarrow, bm_checkyes, bm_checkno, bm_checkna;
 static HDC bitmap_dc;
 
 static struct {
@@ -70,10 +72,16 @@ static struct {
   int x;
 } headers[] = {
   { "Current", 7, 0, 0 },
+#define CURRENT_COL 0
   { "New", 3, 0, 0 },
+#define NEW_COL 1
+  { "Src?", 4, 0, 0 },
+#define SRC_COL 2
   { "Package", 7, 0, 0 },
+#define PACKAGE_COL 3
   { 0, 0, 0, 0 }
 };
+#define NUM_COLUMNS (sizeof(headers)/(sizeof(headers[0]))-1)
 
 int *package_indexes, nindexes;
 
@@ -88,6 +96,7 @@ struct ExtraPackageInfo {
   int which_is_installed; /* == TRUST* or -1 */
 
   struct {
+    int src_avail;
     int trust;         /* may be keep or uninstall */
     char *caption;     /* ==0 at EOL */
   } chooser[NTRUST+3]; /* one extra for NULL above */
@@ -131,27 +140,40 @@ paint (HWND hwnd)
       int by = r + tm.tmHeight - 11;
       if (extra[i].installed_ver && extra[i].installed_ver[0])
        {
-         TextOut (hdc, x+headers[0].x, r, extra[i].installed_ver, strlen (extra[i].installed_ver));
+         TextOut (hdc, x+headers[CURRENT_COL].x, r,
+                  extra[i].installed_ver, strlen (extra[i].installed_ver));
          SelectObject (bitmap_dc, bm_rtarrow);
-         BitBlt (hdc, x+headers[0].x+headers[0].width+ICON_MARGIN/2+HMARGIN/2, by,
+         BitBlt (hdc, x+headers[CURRENT_COL].x+headers[0].width+ICON_MARGIN/2+HMARGIN/2, by,
                  11, 11, bitmap_dc, 0, 0, SRCCOPY);
        }
 
       char *s = extra[i].chooser[extra[i].pick].caption;
       if (s)
        {
-         TextOut (hdc, x+headers[1].x + 11 + ICON_MARGIN, r,
+         TextOut (hdc, x+headers[NEW_COL].x + 11 + ICON_MARGIN, r,
                   s, strlen (s));
          if (extra[i].npick > 1)
            {
              SelectObject (bitmap_dc, bm_spin);
-             BitBlt (hdc, x+headers[1].x, by, 11, 11,
+             BitBlt (hdc, x+headers[NEW_COL].x, by, 11, 11,
                      bitmap_dc, 0, 0, SRCCOPY);
            }
        }
 
+      HANDLE check_bm = bm_checkna;
+      if (extra[i].chooser[extra[i].pick].src_avail)
+       {
+         if (package[i].srcaction == SRCACTION_NO)
+           check_bm = bm_checkno;
+         else if (package[i].srcaction == SRCACTION_YES)
+           check_bm = bm_checkyes;
+       }
+      SelectObject (bitmap_dc, check_bm);
+      BitBlt (hdc, x+headers[SRC_COL].x, by, 11, 11,
+             bitmap_dc, 0, 0, SRCCOPY);
+
       if (package[i].name)
-       TextOut (hdc, x+headers[2].x, r, package[i].name, strlen(package[i].name));
+       TextOut (hdc, x+headers[PACKAGE_COL].x, r, package[i].name, strlen(package[i].name));
     }
 
   if (nindexes == 0)
@@ -247,9 +269,6 @@ list_click (HWND hwnd, BOOL dblclk, int x, int y, UINT hitCode)
   x += scroll_ulc_x;
   y += scroll_ulc_y - header_height;
 
-  if (x < headers[1].x - HMARGIN/2 || x > headers[2].x - HMARGIN/2)
-    return 0;
-
   r = (y + ROW_MARGIN/2) / row_height;
 
   if (r < 0 || r >= npackages)
@@ -257,13 +276,22 @@ list_click (HWND hwnd, BOOL dblclk, int x, int y, UINT hitCode)
 
   int p = package_indexes[r];
 
-  extra[p].pick ++;
-  if (extra[p].chooser[extra[p].pick].caption == 0)
-    extra[p].pick = 0;
+  if (x >= headers[NEW_COL].x - HMARGIN/2 && x <= headers[NEW_COL+1].x - HMARGIN/2)
+    {
+      extra[p].pick ++;
+      if (extra[p].chooser[extra[p].pick].caption == 0)
+       extra[p].pick = 0;
+    }
+
+  if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL+1].x - HMARGIN/2)
+    {
+      if (extra[p].chooser[extra[p].pick].src_avail)
+       package[p].srcaction ^= (SRCACTION_NO^SRCACTION_YES);
+    }
 
   RECT rect;
-  rect.left = headers[1].x - scroll_ulc_x;
-  rect.right = headers[2].x - scroll_ulc_x;
+  rect.left = headers[NEW_COL].x - scroll_ulc_x;
+  rect.right = headers[SRC_COL+1].x - scroll_ulc_x;
   rect.top = header_height + r * row_height - scroll_ulc_y;
   rect.bottom = rect.top + row_height;
   InvalidateRect (hwnd, &rect, TRUE);
@@ -420,10 +448,13 @@ build_labels ()
              if (C.caption == 0 || C.caption[0] == 0)
                C.caption = "0.0";
              C.trust = t;
+             if (package[i].info[t].source)
+               C.src_avail = 1;
              c++;
              /* we intentionally skip TRUST_PREV */
              if (t != TRUST_PREV || !extra[i].installed_ver)
                extra[i].in_partial_list = 1;
+
            }
 
       if (c == 0)
@@ -482,19 +513,21 @@ create_listview (HWND dlg, RECT *r)
     note_width (dc, headers[i].text, 0, i);
   for (i=0; i<npackages; i++)
     {
-      note_width (dc, extra[i].installed_ver, 0, 0);
-      note_width (dc, extra[i].installed_ver, 11+ICON_MARGIN, 1);
+      note_width (dc, extra[i].installed_ver, 0, CURRENT_COL);
+      note_width (dc, extra[i].installed_ver, 11+ICON_MARGIN, NEW_COL);
       for (t=0; t<NTRUST; t++)
-       note_width (dc, package[i].info[t].version, 11+ICON_MARGIN, 1);
-      note_width (dc, package[i].name, 0, 2);
-      note_width (dc, package[i].sdesc, 0, 2);
+       note_width (dc, package[i].info[t].version, 11+ICON_MARGIN, NEW_COL);
+      note_width (dc, package[i].name, 0, PACKAGE_COL);
+      note_width (dc, package[i].sdesc, 0, PACKAGE_COL);
     }
-  note_width (dc, "keep", 11+ICON_MARGIN, 1);
-  note_width (dc, "uninstall", 11+ICON_MARGIN, 1);
+  note_width (dc, "keep", 11+ICON_MARGIN, NEW_COL);
+  note_width (dc, "uninstall", 11+ICON_MARGIN, NEW_COL);
 
-  headers[0].x = HMARGIN/2;
-  headers[1].x = headers[0].x + headers[0].width + HMARGIN + 11 + ICON_MARGIN;
-  headers[2].x = headers[1].x + headers[1].width + HMARGIN;
+  headers[CURRENT_COL].x = HMARGIN/2;
+  headers[NEW_COL].x = (headers[CURRENT_COL].x + headers[CURRENT_COL].width
+                       + HMARGIN + 11 + ICON_MARGIN);
+  headers[SRC_COL].x = headers[NEW_COL].x + headers[NEW_COL].width + HMARGIN;
+  headers[PACKAGE_COL].x = headers[SRC_COL].x + headers[SRC_COL].width + HMARGIN;
 
   set_full_list (lv, full_list);
   default_trust (lv, TRUST_CURR);
@@ -688,20 +721,6 @@ read_installed_db ()
   fclose (db);
 }
 
-static void
-foo1() {
-  int i;
-
-  for (i=0; i<npackages; i++)
-    if (package[i].action == ACTION_UNKNOWN)
-      package[i].action = ACTION_NEW;
-
-  if (source == IDC_SOURCE_CWD)
-    next_dialog = IDD_S_INSTALL;
-  else
-    next_dialog = IDD_S_DOWNLOAD;
-}
-
 int
 package_sort (const void *va, const void *vb)
 {
@@ -721,12 +740,14 @@ do_choose (HINSTANCE h)
   bm_spin = LoadImage (h, MAKEINTRESOURCE (IDB_SPIN), IMAGE_BITMAP, 0, 0, 0);
   bm_rtarrow = LoadImage (h, MAKEINTRESOURCE (IDB_RTARROW), IMAGE_BITMAP, 0, 0, 0);
 
+  bm_checkyes = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_YES), IMAGE_BITMAP, 0, 0, 0);
+  bm_checkno = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_NO), IMAGE_BITMAP, 0, 0, 0);
+  bm_checkna = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_NA), IMAGE_BITMAP, 0, 0, 0);
+
   extra = (ExtraPackageInfo *) malloc (npackages * sizeof (ExtraPackageInfo));
   memset (extra, 0, npackages * sizeof (ExtraPackageInfo));
   for (i=0; i<npackages; i++)
-    {
-      extra[i].which_is_installed = -1;
-    }
+    extra[i].which_is_installed = -1;
 
   register_windows (h);
 
@@ -782,7 +803,8 @@ do_choose (HINSTANCE h)
                            : (package[i].action == ACTION_ERROR) ? "error"
                            : "unknown");
 
-      log (LOG_BABBLE, "[%s] action=%s trust=%s", package[i].name, action, trust);
+      log (LOG_BABBLE, "[%s] action=%s trust=%s src? %s", package[i].name, action, trust,
+          package[i].srcaction == SRCACTION_NO ? "no" : "yes");
       for (int t=0; t<NTRUST; t++)
        {
          if (package[i].info[t].install)
index d5293fb336b1d2a4f4bb809f5c8b8e5563f0ea3c..aef6048c321043e0a593064ed67a16c9b0fcc029 100644 (file)
@@ -36,6 +36,46 @@ static char *cvsid = "\n%%% $Id$\n";
 
 #define pi (package[i].info[package[i].trust])
 
+static int
+download_one (char *name, int expected_size)
+{
+  char *local = name;
+  int errors = 0;
+
+  struct stat s;
+  if (stat (local, &s) >= 0)
+    if (s.st_size == expected_size)
+      return 0;
+
+  mkdir_p (0, local);
+
+  if (get_url_to_file (concat (MIRROR_SITE, "/", name, 0),
+                      concat (local, ".tmp", 0),
+                      expected_size))
+    {
+      note (IDS_DOWNLOAD_FAILED, name);
+      return 1;
+    }
+  else
+    {
+      stat (concat (local, ".tmp", 0), &s);
+      if (s.st_size == expected_size)
+       {
+         log (0, "Downloaded %s", local);
+         rename (concat (local, ".tmp", 0), local);
+       }
+      else
+       {
+         log (0, "Download %s wrong size (%d actual vs %d expected)",
+              local, s.st_size, expected_size);
+         note (IDS_DOWNLOAD_SHORT, local, s.st_size, expected_size);
+         return 1;
+       }
+    }
+
+  return 0;
+}
+
 void
 do_download (HINSTANCE h)
 {
@@ -45,40 +85,12 @@ do_download (HINSTANCE h)
   for (i=0; i<npackages; i++)
     if (package[i].action == ACTION_NEW || package[i].action == ACTION_UPGRADE)
       {
-       char *local = pi.install;
-
-       struct stat s;
-       if (stat (local, &s) >= 0)
-         if (s.st_size == pi.install_size)
-           continue;
-
-       mkdir_p (0, local);
-
-       if (get_url_to_file (concat (MIRROR_SITE, "/", pi.install, 0),
-                            concat (local, ".tmp", 0),
-                            pi.install_size))
-         {
-           note (IDS_DOWNLOAD_FAILED, pi.install);
-           package[i].action = ACTION_ERROR;
-           errors ++;
-           continue;
-         }
-       else
-         {
-           stat (concat (local, ".tmp", 0), &s);
-           if (s.st_size == pi.install_size)
-             {
-               log (0, "Downloaded %s", local);
-               rename (concat (local, ".tmp", 0), local);
-             }
-           else
-             {
-               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 ++;
-             }
-         }
+       int e = download_one (pi.install, pi.install_size);
+       if (package[i].srcaction == SRCACTION_YES && pi.source)
+         e += download_one (pi.source, pi.source_size);
+       errors += e;
+       if (e)
+         package[i].action = ACTION_ERROR;
       }
 
   dismiss_url_status_dialog ();
index 8d79409daf74211f6c56ef78436506dfbc534ee6..a87e235e2380c6ef372942686e6b8ecbcb894f2f 100644 (file)
@@ -154,5 +154,31 @@ do_fromcwd (HINSTANCE h)
 
   find (".", found_file);
 
+  // Now see about source tarballs
+  int i, t;
+  Package *p;
+  char srcpath[_MAX_PATH];
+  for (i=0; i<npackages; i++)
+    {
+      p = package+i;
+      for (t=TRUST_PREV; t<=TRUST_TEST; t++)
+       if (p->info[t].install)
+         {
+           strcpy (srcpath, p->info[t].install);
+           strcpy (srcpath + strlen (srcpath) - 7, "-src.tar.gz");
+           msg ("looking for %s", srcpath);
+
+           WIN32_FIND_DATA wfd;
+           HANDLE h = FindFirstFile (srcpath, &wfd);
+           if (h != INVALID_HANDLE_VALUE)
+             {
+               msg("-- got it");
+               FindClose (h);
+               p->info[t].source = _strdup (srcpath);
+               p->info[t].source_size = wfd.nFileSizeLow;
+             }
+         }
+    }
+
   return;
 }
diff --git a/ini.h b/ini.h
index 893a1342c841bb71a5cacf089d6b626aab077387..5dae67a0ac182f3a55f59360f00e63998ab0b0a1 100644 (file)
--- a/ini.h
+++ b/ini.h
 #define ACTION_UNINSTALL       4
 #define ACTION_ERROR           5
 
+#define SRCACTION_NO           0
+#define SRCACTION_YES          1
+
 typedef struct {
   char *name;  /* package name, like "cygwin" */
   char *sdesc; /* short description (replaces "name" if provided) */
   char *ldesc; /* long description (multi-line) */
   int action;  /* ACTION_* - only NEW and UPGRADE get installed */
+  int srcaction;/* SRCACTION_ */
   int trust;   /* TRUST_* (selects among info[] below) */
 
   struct {
index 62e8ef2dbbf9ae00e000b2077c5dd0a7bb59176b..9832121ee30ee30ab0d93b6fd3839f39b99de892 100644 (file)
@@ -238,12 +238,139 @@ exists (char *file)
   return 0;
 }
 
+         
+static int num_installs, num_uninstalls;
+
+static void
+uninstall_one (char *name, int action)
+{
+  hash dirs;
+  char line[_MAX_PATH];
+
+  gzFile lst = gzopen (concat (root_dir, "/etc/setup/",
+                              name, ".lst.gz", 0),
+                      "rb");
+  if (lst)
+    {
+      SetWindowText (ins_pkgname, name);
+      SetWindowText (ins_action, "Uninstalling...");
+      if (action == ACTION_UPGRADE)
+       log (0, "Uninstalling old %s", name);
+      else
+       log (0, "Uninstalling %s", name);
+
+      while (gzgets (lst, line, sizeof (line)))
+       {
+         if (line[strlen(line)-1] == '\n')
+           line[strlen(line)-1] = 0;
+
+         dirs.add_subdirs (line);
+
+         char *d = map_filename (line);
+         DWORD dw = GetFileAttributes (d);
+         if (dw != 0xffffffff && !(dw & FILE_ATTRIBUTE_DIRECTORY))
+           {
+             log (LOG_BABBLE, "unlink %s", d);
+             DeleteFile (d);
+           }
+       }
+      gzclose (lst);
+
+      remove (concat (root_dir, "/etc/setup/", name, ".lst.gz", 0));
+
+      dirs.reverse_sort ();
+      char *subdir = 0;
+      while ((subdir = dirs.enumerate (subdir)) != 0)
+       {
+         char *d = map_filename (subdir);
+         if (RemoveDirectory (d))
+           log (LOG_BABBLE, "rmdir %s", d);
+       }
+      num_uninstalls ++;
+    }
+}
+
+         
+static int
+install_one (char *name, char *file, int file_size, int action)
+{
+  int errors = 0;
+  char *local = file, *cp, *fn, *base;
+
+  base = local;
+  for (cp=local; *cp; cp++)
+    if (*cp == '/' || *cp == '\\' || *cp == ':')
+      base = cp+1;
+  SetWindowText (ins_pkgname, base);
+
+  if (!exists (local) && exists (base))
+    local = base;
+  if (!exists (local))
+    {
+      note (IDS_ERR_OPEN_READ, local, "No such file");
+      return 1;
+    }
+
+  gzFile lst = gzopen (concat (root_dir, "/etc/setup/",
+                              name, ".lst.gz", 0),
+                      "wb9");
+
+  package_bytes = file_size;
+
+  switch (action)
+    {
+    case ACTION_NEW:
+      SetWindowText (ins_action, "Installing...");
+      break;
+    case ACTION_UPGRADE:
+      SetWindowText (ins_action, "Upgrading...");
+      break;
+    }
+
+  log (0, "Installing %s", local);
+  tar_open (local);
+  while (fn = tar_next_file ())
+    {
+      char *dest_file;
+
+      if (lst)
+       gzprintf (lst, "%s\n", fn);
+
+      dest_file = map_filename (fn);
+
+      SetWindowText (ins_filename, dest_file);
+      log (LOG_BABBLE, "Installing file %s", dest_file);
+      if (tar_read_file (dest_file) != 0)
+       {
+         log (0, "Unable to install file %s", dest_file);
+         errors ++;
+       }
+
+      progress (tar_ftell ());
+      num_installs ++;
+    }
+  tar_close ();
+
+  total_bytes_sofar += file_size;
+  progress (0);
+
+  int df = diskfull (root_dir);
+  SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
+
+  if (lst)
+    gzclose (lst);
+
+  return errors;
+}
+
 void
 do_install (HINSTANCE h)
 {
-  int i, num_installs = 0, num_uninstalls = 0;
+  int i;
   int errors = 0;
 
+  num_installs = 0, num_uninstalls = 0;
+
   next_dialog = IDD_DESKTOP;
 
   mkdir_p (1, root_dir);
@@ -282,121 +409,23 @@ do_install (HINSTANCE h)
       if (package[i].action == ACTION_UNINSTALL
          || (package[i].action == ACTION_UPGRADE && pi.install))
        {
-         hash dirs;
-         char line[_MAX_PATH];
-
-         gzFile lst = gzopen (concat (root_dir, "/etc/setup/",
-                                      package[i].name, ".lst.gz", 0),
-                              "rb");
-         if (lst)
-           {
-             SetWindowText (ins_pkgname, package[i].name);
-             SetWindowText (ins_action, "Uninstalling...");
-             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)))
-               {
-                 if (line[strlen(line)-1] == '\n')
-                   line[strlen(line)-1] = 0;
-
-                 dirs.add_subdirs (line);
-
-                 char *d = map_filename (line);
-                 DWORD dw = GetFileAttributes (d);
-                 if (dw != 0xffffffff && !(dw & FILE_ATTRIBUTE_DIRECTORY))
-                   {
-                     log (LOG_BABBLE, "unlink %s", d);
-                     DeleteFile (d);
-                   }
-               }
-             gzclose (lst);
-
-             dirs.reverse_sort ();
-             char *subdir = 0;
-             while ((subdir = dirs.enumerate (subdir)) != 0)
-               {
-                 char *d = map_filename (subdir);
-                 if (RemoveDirectory (d))
-                   log (LOG_BABBLE, "rmdir %s", d);
-               }
-             num_uninstalls ++;
-           }
+         uninstall_one (package[i].name, package[i].action);
+         uninstall_one (concat (package[i].name, "-src", 0), package[i].action);
        }
 
       if ((package[i].action == ACTION_NEW
           || package[i].action == ACTION_UPGRADE)
          && pi.install)
        {
-         char *local = pi.install, *cp, *fn, *base;
-
-         base = local;
-         for (cp=pi.install; *cp; cp++)
-           if (*cp == '/' || *cp == '\\' || *cp == ':')
-             base = cp+1;
-         SetWindowText (ins_pkgname, base);
-
-         if (!exists (local) && exists (base))
-           local = base;
-         if (!exists (local))
+         int e = install_one (package[i].name, pi.install, pi.install_size, package[i].action);
+         if (package[i].srcaction == SRCACTION_YES && pi.source)
+           e += install_one (concat (package[i].name, "-src", 0), pi.source, pi.source_size,
+                             package[i].action);
+         if (e)
            {
              package[i].action = ACTION_ERROR;
-             note (IDS_ERR_OPEN_READ, local, "No such file");
-             errors ++;
-             continue;
+             errors++;
            }
-
-         gzFile lst = gzopen (concat (root_dir, "/etc/setup/",
-                                      package[i].name, ".lst.gz", 0),
-                              "wb9");
-
-         package_bytes = pi.install_size;
-
-         switch (package[i].action)
-           {
-           case ACTION_NEW:
-             SetWindowText (ins_action, "Installing...");
-             break;
-           case ACTION_UPGRADE:
-             SetWindowText (ins_action, "Upgrading...");
-             break;
-           }
-
-         log (0, "Installing %s", local);
-         tar_open (local);
-         while (fn = tar_next_file ())
-           {
-             char *dest_file;
-
-             if (lst)
-               gzprintf (lst, "%s\n", fn);
-
-             dest_file = map_filename (fn);
-
-             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;
-                 log (0, "Unable to install file %s", dest_file);
-                 errors ++;
-               }
-
-             progress (tar_ftell ());
-             num_installs ++;
-           }
-         tar_close ();
-
-         total_bytes_sofar += pi.install_size;
-         progress (0);
-
-         df = diskfull (root_dir);
-         SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
-
-         if (lst)
-           gzclose (lst);
        }
     } // end of big package loop
 
@@ -447,8 +476,13 @@ do_install (HINSTANCE h)
 
   LOOP_PACKAGES
     {
-      fprintf (ndb, "%s %s %d\n", package[i].name,
-              pi.install, pi.install_size);
+      if (package[i].srcaction == SRCACTION_YES)
+       fprintf (ndb, "%s %s %d %s %d\n", package[i].name,
+                pi.install, pi.install_size,
+                pi.source, pi.source_size);
+      else
+       fprintf (ndb, "%s %s %d\n", package[i].name,
+                pi.install, pi.install_size);
     }
 
   if (odb)
diff --git a/res.rc b/res.rc
index 90695ba4771224e887631ec20538f86068b36891..be210f0a142445d53dae4025efc879bfb50eaab9 100644 (file)
--- a/res.rc
+++ b/res.rc
@@ -334,6 +334,9 @@ END
 SPIN                    BITMAP  DISCARDABLE     "choose-spin.bmp"
 IDB_SPIN                BITMAP  DISCARDABLE     "choose-spin.bmp"
 IDB_RTARROW             BITMAP  DISCARDABLE     "choose-rtarrow.bmp"
+IDB_CHECK_YES           BITMAP  DISCARDABLE     "check-yes.bmp"
+IDB_CHECK_NO            BITMAP  DISCARDABLE     "check-no.bmp"
+IDB_CHECK_NA            BITMAP  DISCARDABLE     "check-na.bmp"
 
 /////////////////////////////////////////////////////////////////////////////
 //
index c2ac1704eaba5a6b15557750b1f5efac6ac026dd..089f20af9bb1283d0f121045f46714cacd5bf7f4 100644 (file)
@@ -24,9 +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 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
@@ -49,6 +49,9 @@
 #define IDI_SPIN                        120
 #define IDI_CYGWIN                      121
 #define IDD_LOCAL_DIR                   122
+#define IDB_CHECK_YES                   123
+#define IDB_CHECK_NO                    124
+#define IDB_CHECK_NA                    125
 #define IDC_SOURCE_DOWNLOAD             1000
 #define IDC_SOURCE_NETINST              1001
 #define IDC_SOURCE_CWD                  1002
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC                     1
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        123
+#define _APS_NEXT_RESOURCE_VALUE        126
 #define _APS_NEXT_COMMAND_VALUE         40003
 #define _APS_NEXT_CONTROL_VALUE         1045
 #define _APS_NEXT_SYMED_VALUE           101
This page took 0.056597 seconds and 5 git commands to generate.