]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* package_db.cc (ConnectedLoopFinder::doIt): Revert patch from
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 7 May 2009 14:14:58 +0000 (14:14 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 7 May 2009 14:14:58 +0000 (14:14 +0000)
2008-08-29.  Add dumb hardcoded algorithm to make sure base-cygwin
and base-passwd are always the first packages in the postinstall
executable order.

ChangeLog
package_db.cc

index 89b1002c84772f8b850b5930b9cc82e06a898e2e..8c598cec567f7ecd36a415e7252694eebd8a4e37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-07  Corinna Vinschen  <corinna@vinschen.de>
+
+       * package_db.cc (ConnectedLoopFinder::doIt): Revert patch from
+       2008-08-29.  Add dumb hardcoded algorithm to make sure base-cygwin
+       and base-passwd are always the first packages in the postinstall
+       executable order.
+
 2009-05-06  Corinna Vinschen  <corinna@vinschen.de>
 
        * install.cc (Installer::StandardDirs): Add /home with 1777 perms.
index bf293d394728da6b8d411200d392bb99fbd9752a..bb061de2d6a10a861fc9a8ce21aafa985ed65124 100644 (file)
@@ -244,53 +244,33 @@ ConnectedLoopFinder::doIt()
      sorting which would be a result of the below algorithm looking for
      strongly connected components in a directed graph.  Unfortunately it's
      not possible to order a directed graph with loops topologially.
-     The idea here is to look for packages with no dependencies first,
-     then for the packages which only depend on these packages, then
-     packages which depend on these and another one.  The last loop then
-     collects all the rest.  This is not foolproof, but it should easy
-     the pain.  */
+     UGLY, but we really have to make sure that "base-cygwin" and
+     "base-passwd" run first, whatever the dependency loops come up with in
+     future.
+     FIXME: Find another depnendecy mechanism which ensures this without
+            hardcoding. */
   for (size_t i = 0; i < db.packages.size(); ++i)
     {
       packagemeta &pkg (*db.packages[i]);
-      if (pkg.installed && pkg.installed.depends ()->size () == 0)
-       visit (i);
+      if (pkg.installed && casecompare (pkg.name, "base-cygwin"))
+       {
+         visit (i);
+         break;
+       }
     }
-  /* FIXME: Is there a more elegant way to get the same? */
-  size_t num_packages = 1;
-  for (size_t cnt = 0; cnt < 5; ++cnt)
+  for (size_t i = 0; i < db.packages.size(); ++i)
     {
-      if (cnt == 3)
-       num_packages = 2;
-      for (size_t i = 0; i < db.packages.size(); ++i)
+      packagemeta &pkg (*db.packages[i]);
+      if (pkg.installed && casecompare (pkg.name, "base-passwd"))
        {
-         packagemeta &pkg (*db.packages[i]);
-         if (visitOrder[i] || !pkg.installed
-             || pkg.installed.depends ()->size () != num_packages)
-           continue;
-         for (PackageDBConnectedIterator j = db.connectedBegin ();
-              j != db.connectedEnd ();
-              ++j)
-           {
-             for (vector <vector <PackageSpecification *> *>::iterator dp
-                    = pkg.installed.depends ()->begin ();
-                  dp != pkg.installed.depends ()->end ();
-                  ++dp)
-               for (vector <PackageSpecification *>::iterator dp2
-                    = (*dp)->begin (); dp2 != (*dp)->end (); ++dp2)
-                 if (!casecompare ((*j)->name, (*dp2)->packageName ()))
-                   {
-                     visit (i);
-                     goto post_conn_iterate;
-                   }
-           }
-  post_conn_iterate:
-         ;
+         visit (i);
+         break;
        }
     }
   for (size_t i = 0; i < db.packages.size(); ++i)
     {
       packagemeta &pkg (*db.packages[i]);
-      if (pkg.installed && ! visitOrder[i])
+      if (pkg.installed && !visitOrder[i])
        visit (i);
     }
   log (LOG_BABBLE) << "Visited: " << visited << " nodes out of "
This page took 0.04235 seconds and 5 git commands to generate.