Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7113 - in /trunk/libzypp/zypp/solver/detail: QueueItemRequire.cc Resolver.cc Resolver.h Resolver_problems.cc SolutionAction.cc
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Wed, 05 Sep 2007 15:52:16 -0000
  • Message-id: <20070905155216.AC3602512E@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Wed Sep  5 17:52:16 2007
New Revision: 7113

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7113&view=rev
Log:
- logging "reverse" NEEDED_BY in the detail description of solver
  problems.
- improved error message if a requiremnt is not fulfilled Bug 307743
- Add "ignore" option to the solution if a requirement is not fulfilled
  Bug 304276 

Modified:
    trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc
    trunk/libzypp/zypp/solver/detail/Resolver.cc
    trunk/libzypp/zypp/solver/detail/Resolver.h
    trunk/libzypp/zypp/solver/detail/Resolver_problems.cc
    trunk/libzypp/zypp/solver/detail/SolutionAction.cc

Modified: trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc?rev=7113&r1=7112&r2=7113&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc (original)
+++ trunk/libzypp/zypp/solver/detail/QueueItemRequire.cc Wed Sep  5 17:52:16 2007
@@ -615,7 +615,6 @@
                }
 
                // now check if a provider supplements or enhances an installed or to-be-installed resolvable
-
                if (hint_match( item->dep( Dep::SUPPLEMENTS ), pool() )
                    || hint_match( item->dep( Dep::ENHANCES ), pool() ))
                {

Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=7113&r1=7112&r2=7113&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Wed Sep  5 17:52:16 2007
@@ -422,6 +422,13 @@
     _extra_caps.insert (capability);
 }
 
+void
+Resolver::removeExtraCapability (const Capability & capability)
+{
+    _extra_caps.erase (capability);
+}
+
+
 
 void
 Resolver::addExtraConflict (const Capability & capability)

Modified: trunk/libzypp/zypp/solver/detail/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.h?rev=7113&r1=7112&r2=7113&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.h Wed Sep  5 17:52:16 2007
@@ -225,6 +225,7 @@
     void addPoolItemToVerify (PoolItem_Ref item);
 
     void addExtraCapability (const Capability & capability);
+    void removeExtraCapability (const Capability & capability);
     void addExtraConflict (const Capability & capability);
 
     const CapSet extraCapability () { return _extra_caps; }

Modified: trunk/libzypp/zypp/solver/detail/Resolver_problems.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver_problems.cc?rev=7113&r1=7112&r2=7113&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver_problems.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver_problems.cc Wed Sep  5 17:52:16 2007
@@ -136,6 +136,16 @@
        collector->problems.insert (make_pair( item, info));
     } else {
        collector->additionalInfo.insert (make_pair( item, info));
+
+       if (info->type()==RESOLVER_INFO_TYPE_NEEDED_BY) { // logging reverse needed by
+           ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
+           PoolItemList itemList = needed_by->items();
+           for (PoolItemList::const_iterator iter = itemList.begin();
+                iter != itemList.end(); ++iter)
+           {
+               collector->additionalInfo.insert (make_pair( *iter, info));
+           }
+       }
     }
 
     // Collicting items which are providing requirements but they
@@ -699,8 +709,13 @@
                    break;
                case RESOLVER_INFO_TYPE_NO_PROVIDER: {                  // There are no installable providers of c [for p]
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
-                   // TranslatorExplanation %s = name of package, patch, selection ...                         
-                   what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());             
+                   if (item.status().isInstalled()) {
+                       // TranslatorExplanation %s = name of package, patch, selection ...                             
+                       what = str::form (_("%s has missing dependencies"), whoShort.c_str());
+                   } else {
+                       // TranslatorExplanation %s = name of package, patch, selection ...
+                       what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());                 
+                   }
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);                               
                    ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -947,6 +962,8 @@
                        details += more_details;
                    }
                    ResolverProblem_Ptr problem = new ResolverProblem (what, details);
+                   // ignore requirement
+                   problem->addSolution (new ProblemSolutionIgnoreRequires (problem, PoolItem_Ref(), misc_info->capability())); 
                    problems.push_back (problem);
                    problem_created = true;             
                }

Modified: trunk/libzypp/zypp/solver/detail/SolutionAction.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SolutionAction.cc?rev=7113&r1=7112&r2=7113&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SolutionAction.cc (original)
+++ trunk/libzypp/zypp/solver/detail/SolutionAction.cc Wed Sep  5 17:52:16 2007
@@ -181,8 +181,12 @@
 bool
 InjectSolutionAction::execute(Resolver & resolver) const
 {
-    Dependencies dependencies = _item.resolvable()->deps();
-    CapSet depList = dependencies[Dep::CONFLICTS];    
+    Dependencies dependencies;
+    CapSet depList;
+    if (_item != PoolItem_Ref()) {    
+       dependencies = _item.resolvable()->deps();
+       depList = dependencies[Dep::CONFLICTS];
+    }
     switch (_kind) {
         case CONFLICTS:
            // removing conflict in both resolvables
@@ -221,7 +225,13 @@
            break;
         case REQUIRES:
            // removing the requires dependency from the item
-           resolver.addIgnoreRequires (_item, _capability);
+           if (_item == PoolItem_Ref()) {
+               // this was a requirement via Resolver::addExtraCapability
+               // so we have to delete it.
+               resolver.removeExtraCapability (_capability);
+           } else {
+               resolver.addIgnoreRequires (_item, _capability);
+           }
            break;
         case ARCHITECTURE:
            // This item is for ALL architectures available

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

< Previous Next >
This Thread
  • No further messages