Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5349 - in /trunk/libzypp/zypp/solver/detail: InstallOrder.cc InstallOrder.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 12 Apr 2007 00:40:07 -0000
  • Message-id: <20070412004007.3F63B236A0@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Apr 12 02:40:06 2007
New Revision: 5349

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5349&view=rev
Log:
- Fixed computation of install order. Take requirements of
  an installed packages uninstall scripts into account, if
  the package is updated. (#258682)

Modified:
    trunk/libzypp/zypp/solver/detail/InstallOrder.cc
    trunk/libzypp/zypp/solver/detail/InstallOrder.h

Modified: trunk/libzypp/zypp/solver/detail/InstallOrder.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/InstallOrder.cc?rev=5349&r1=5348&r2=5349&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/InstallOrder.cc (original)
+++ trunk/libzypp/zypp/solver/detail/InstallOrder.cc Thu Apr 12 02:40:06 2007
@@ -28,13 +28,14 @@
 /-*/
 
 #include "zypp/solver/detail/InstallOrder.h"
-#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
 #include "zypp/base/Iterator.h"
 #include "zypp/base/Algorithm.h"
 
 #include "zypp/ResFilters.h"
 #include "zypp/ResStatus.h"
 #include "zypp/CapAndItem.h"
+#include "zypp/NameKindProxy.h"
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp
@@ -225,20 +226,29 @@
     nodeinfo.begintime = _rdfstime;
     _rdfstime++;
 
+    // items prereq
+    CapSet prq( item->dep(Dep::PREREQUIRES) );
+    // an installed items prereq (in case they are reqired for uninstall scripts)
+    NameKindProxy nkp( _pool, item->name(), item->kind() );
+    if ( ! nkp.installedEmpty() )
+    {
+      prq.insert( (*nkp.installedBegin())->dep(Dep::PREREQUIRES).begin(),
+                 (*nkp.installedBegin())->dep(Dep::PREREQUIRES).end() );
+    }
     // put prerequires first and requires last on list to ensure
     // that prerequires are processed first
-    for (CapSet::const_iterator it = item->dep (Dep::PREREQUIRES).begin(); it != item->dep (Dep::PREREQUIRES).end(); ++it)
+    for (CapSet::const_iterator it = prq.begin(); it != prq.end(); ++it)
     {
-       const Capability cap = *it;
-       requires.push_back(cap);
+       requires.push_back(*it);
     }
 
+    // Product requirements are ignored to assert Product gets installed
+    // as early as possible. Some stuff depends on it (e.g. registration).
     if ( ! isKind<Product>( item.resolvable() ) )
       {
         for (CapSet::const_iterator it = item->dep (Dep::REQUIRES).begin(); it != item->dep (Dep::REQUIRES).end(); ++it)
           {
-            const Capability cap = *it;
-            requires.push_back(cap);
+            requires.push_back(*it);
           }
       }
 

Modified: trunk/libzypp/zypp/solver/detail/InstallOrder.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/InstallOrder.h?rev=5349&r1=5348&r2=5349&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/InstallOrder.h (original)
+++ trunk/libzypp/zypp/solver/detail/InstallOrder.h Thu Apr 12 02:40:06 2007
@@ -85,7 +85,7 @@
            NodeInfo() : begintime(0), endtime(0), visited(false), order(0) {}
            NodeInfo(PoolItem_Ref item) : begintime(0), endtime(0), visited(false), order(0), item(item) {}
        };
-       
+
        typedef std::map<PoolItem_Ref, NodeInfo> Nodes;
 
        Nodes _nodes;
@@ -106,7 +106,7 @@
 
     public:
 
-       /** 
+       /**
         * Constructor
         *
         * @param toinstall Set of ResItems that have to be installed
@@ -125,7 +125,7 @@
         * set then
         * */
        void setInstalled( PoolItem_Ref item );
-       
+
        /**
         * like above, for convenience
         * */

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages