]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* choose.cc (set_action): Only clear srcpicked when moving to next state.
authorChristopher Faylor <me@cgf.cx>
Mon, 25 Jun 2001 05:48:38 +0000 (05:48 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 25 Jun 2001 05:48:38 +0000 (05:48 +0000)
Allow source installation if it exists in the current "trust" state.  Don't
move to skip state when package is installed.
(list_click): Don't allow source clicking when no source is available.
(set_full_list): Display package when not is_full_action.
* ini.h (is_full_action): Define.

ChangeLog
choose.cc
ini.h

index 62cca39f7fba2903506e27123d6a1c1d386f0ae6..9ad306e11eae90d755bd07552798af8865024056 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Jun 25 00:56:37 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * choose.cc (set_action): Only clear srcpicked when moving to next state.
+       Allow source installation if it exists in the current "trust" state.
+       Don't move to skip state when package is installed.
+       (list_click): Don't allow source clicking when no source is available.
+       (set_full_list): Display package when not is_full_action.
+       * ini.h (is_full_action): Define.
+
 Sun Jun 17 12:06:14 2001  Christopher Faylor <cgf@cygnus.com>
 
        * install.cc (check_for_old_cygwin): New function.  First stab at
index ba7b65c4c9acec156893922ee9d532d0385f68d0..170dd3d6483380504cd88acc5ed5507a2998617f 100644 (file)
--- a/choose.cc
+++ b/choose.cc
@@ -100,9 +100,11 @@ isinstalled (Package *pkg, int trust)
 static void
 set_action (Package *pkg, bool preinc)
 {
-  pkg->srcpicked = 0;
   if (!pkg->action || preinc)
-    ((int) pkg->action)++;
+    {
+      ((int) pkg->action)++;
+      pkg->srcpicked = 0;
+    }
 
   /* Exercise the action state machine. */
   for (;; ((int) pkg->action)++)
@@ -145,21 +147,28 @@ set_action (Package *pkg, bool preinc)
       case ACTION_UNINSTALL:
        if (pkg->installed)
          return;
+       break;
       case ACTION_REDO:
-       if (pkg->installed)
+       if (pkg->installed && pkg->info[pkg->installed_ix].install_exists)
          {
            pkg->trust = pkg->installed_ix;
            return;
          }
+       break;
       case ACTION_SRC_ONLY:
-       if (pkg->installed && pkg->installed->source_exists)
-         return;
+       if (pkg->info[pkg->trust].source_exists)
+         {
+           pkg->srcpicked = 1;
+           return;
+         }
        break;
       case ACTION_SAME_LAST:
        pkg->action = ACTION_SKIP;
        /* Fall through intentionally */
       case ACTION_SKIP:
-       return;
+       if (!pkg->installed || !pkg->info[pkg->installed_ix].install_exists)
+         return;
+       break;
       default:
        log (0, "should never get here %d\n", pkg->action);
       }
@@ -370,7 +379,8 @@ list_click (HWND hwnd, BOOL dblclk, int x, int y, UINT hitCode)
   if (x >= headers[NEW_COL].x - (HMARGIN / 2) && x <= headers[NEW_COL + 1].x - HMARGIN/2)
     set_action (pkg, 1);
 
-  if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL + 1].x - HMARGIN/2)
+  if (pkg->info[pkg->trust].source_exists &&
+      x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL + 1].x - HMARGIN/2)
     pkg->srcpicked ^= 1;
 
   RECT rect;
@@ -504,7 +514,7 @@ set_full_list (HWND h, int isfull)
     if (!pkg->exclude)
       {
        set_action (pkg, 0);
-       if ((isfull || is_download_action (pkg)))
+       if (isfull || !is_full_action (pkg))
          package_indexes[nindexes++] = pkg - package;
       }
 
@@ -983,7 +993,7 @@ do_choose (HINSTANCE h)
                 (pkg->info[t].install_exists) ? "yes":"no",
                 pkg->info[t].source ?: "(none)",
                 pkg->info[t].source_size,
-                (pkg->info[t].source_exists == 1) ? "yes":"no");
+                (pkg->info[t].source_exists == 1) ? "yes" : "no");
        }
     }
 }
diff --git a/ini.h b/ini.h
index c50773cf908264df46fa295adcf378b29af782e8..730935c5240f34825c0de5851961fecc5646b693 100644 (file)
--- a/ini.h
+++ b/ini.h
@@ -79,6 +79,10 @@ typedef enum
    (pkg)->action == ACTION_PREV || \
    (pkg)->action == ACTION_UNINSTALL)
 
+#define is_full_action(pkg) \
+  (((pkg)->action >= ACTION_SAME_PREV && (pkg)->action <= ACTION_SAME_TEST) \
+   || (pkg)->action == ACTION_SKIP)
+
 #define SRCACTION_NO           0
 #define SRCACTION_YES          1
 typedef struct _Info
This page took 0.03499 seconds and 5 git commands to generate.