]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* choose.cc: Add some comments.
authorChristopher Faylor <me@cgf.cx>
Thu, 14 Jun 2001 03:38:45 +0000 (03:38 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 14 Jun 2001 03:38:45 +0000 (03:38 +0000)
(getpkgbyname): Use strcasecmp for comparisons.

ChangeLog
choose.cc

index d53975c061051bfef962633a2f0995fe58d10e5f..6224be3ff1408e8c74e613c7a7d5a5103cd95f20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jun 13 23:33:08 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * choose.cc:  Add some comments.
+       (getpkgbyname): Use strcasecmp for comparisons.
+
 Wed Jun 13 16:07:00 2001  Christopher Faylor <cgf@cygnus.com>
 
        * install.cc (do_install): Avoid checking for download action if
index 5f4db66de9b50d362e259a383075c136cba37507..aaaeb344e1f6871c5fefe442b97e08cd26b1a014 100644 (file)
--- a/choose.cc
+++ b/choose.cc
@@ -99,12 +99,15 @@ isinstalled (Package *pkg, int trust)
           strcmp (pkg->installed->version, pkg->info[trust].version) == 0;
 }
 
+/* Set the next action given a current action.  */
 static void
 set_action (Package *pkg, bool preinc)
 {
   pkg->srcpicked = 0;
   if (!pkg->action || preinc)
     ((int) pkg->action)++;
+
+  /* Exercise the action state machine. */
   for (;; ((int) pkg->action)++)
     switch (pkg->action)
       {
@@ -118,6 +121,8 @@ set_action (Package *pkg, bool preinc)
       case ACTION_PREV:
       case ACTION_CURR:
       case ACTION_TEST:
+       /* Try to find the next best action.  We may not have all of
+          prev, curr, or test but we should have at least one of those. */
        Info *inf;
        inf = pkg->info + pkg->action;
        if (inf->version && inf->install_exists)
@@ -127,6 +132,8 @@ set_action (Package *pkg, bool preinc)
            return;
          }
        break;
+      /* ACTION_SAME_* are used when the installed version is the same
+        as the given action. */
       case ACTION_SAME_CURR:
       case ACTION_SAME_TEST:
        (int) pkg->action -= ACTION_SAME + 1;   /* revert to ACTION_CURR, etc. */
@@ -152,6 +159,7 @@ set_action (Package *pkg, bool preinc)
       }
 }
 
+/* Return an appropriate caption given the current action. */
 const char *
 choose_caption (Package *pkg)
 {
@@ -434,6 +442,8 @@ check_existence (Info *inf, int check_src)
   return 0;
 }
 
+/* Iterate over the package list, setting the "existence" flags
+   for the source or binary. */
 static void
 set_existence ()
 {
@@ -699,6 +709,7 @@ find_tar_ext (const char *path)
   return p - path;
 }
 
+/* Parse a filename into package, version, and extension components. */
 int
 parse_filename (const char *in_fn, fileparse& f)
 {
@@ -762,11 +773,12 @@ parse_filename (const char *in_fn, fileparse& f)
   return 1;
 }
 
+/* Return a pointer to a package given the name. */
 Package *
 getpkgbyname (const char *pkgname)
 {
   for (int i = 0; i < npackages; i++)
-    if (strcmp (package[i].name, pkgname) == 0)
+    if (strcasecmp (package[i].name, pkgname) == 0)
       return package + i;
 
   return NULL;
This page took 0.035141 seconds and 5 git commands to generate.