]>
git.saurik.com Git - apt.git/blob - apt-private/private-unmet.cc
1 // -*- mode: cpp; mode: fold -*-
2 // Include Files /*{{{*/
5 #include <apt-pkg/cachefile.h>
6 #include <apt-pkg/cmndline.h>
7 #include <apt-pkg/configuration.h>
8 #include <apt-pkg/strutl.h>
10 #include <apt-private/private-cacheset.h>
11 #include <apt-private/private-unmet.h>
20 // UnMet - Show unmet dependencies /*{{{*/
21 static bool ShowUnMet(pkgCache::VerIterator
const &V
, bool const Important
)
24 for (pkgCache::DepIterator D
= V
.DependsList(); D
.end() == false;)
27 pkgCache::DepIterator Start
;
28 pkgCache::DepIterator End
;
31 // Important deps only
32 if (Important
== true)
33 if (End
->Type
!= pkgCache::Dep::PreDepends
&&
34 End
->Type
!= pkgCache::Dep::Depends
)
37 // Skip conflicts and replaces
38 if (End
.IsNegative() == true || End
->Type
== pkgCache::Dep::Replaces
)
41 // Verify the or group
43 pkgCache::DepIterator RealStart
= Start
;
46 // See if this dep is Ok
47 pkgCache::Version
**VList
= Start
.AllTargets();
68 ioprintf(std::cout
,_("Package %s version %s has an unmet dep:\n"),
69 V
.ParentPkg().FullName(true).c_str(),V
.VerStr());
72 // Print out the dep type
73 std::cout
<< " " << End
.DepType() << ": ";
79 std::cout
<< Start
.TargetPkg().FullName(true);
80 if (Start
.TargetVer() != 0)
81 std::cout
<< " (" << Start
.CompType() << " " << Start
.TargetVer() <<
90 std::cout
<< std::endl
;
94 bool UnMet(CommandLine
&CmdL
)
96 bool const Important
= _config
->FindB("APT::Cache::Important",false);
98 pkgCacheFile CacheFile
;
99 if (unlikely(CacheFile
.GetPkgCache() == NULL
))
102 if (CmdL
.FileSize() <= 1)
104 for (pkgCache::PkgIterator P
= CacheFile
.GetPkgCache()->PkgBegin(); P
.end() == false; ++P
)
105 for (pkgCache::VerIterator V
= P
.VersionList(); V
.end() == false; ++V
)
106 if (ShowUnMet(V
, Important
) == false)
111 CacheSetHelperVirtuals
helper(true, GlobalError::NOTICE
);
112 APT::VersionList verset
= APT::VersionList::FromCommandLine(CacheFile
, CmdL
.FileList
+ 1,
113 APT::CacheSetHelper::CANDIDATE
, helper
);
114 for (APT::VersionList::iterator V
= verset
.begin(); V
!= verset
.end(); ++V
)
115 if (ShowUnMet(V
, Important
) == false)