339
339
/* Check simple depends. A depends -should- never self match but
340
340
we allow it anyhow because dpkg does. Technically it is a packaging
341
341
bug. Conflicts may never self match */
342
if (Dep.TargetPkg() != Dep.ParentPkg() ||
343
(Dep->Type != Dep::Conflicts && Dep->Type != Dep::DpkgBreaks && Dep->Type != Dep::Obsoletes))
342
if (Dep.TargetPkg() != Dep.ParentPkg() || Dep.IsNegative() == false)
345
344
PkgIterator Pkg = Dep.TargetPkg();
346
345
// Check the base package
1090
1080
if (IsImportantDep(Start) == false)
1083
/* If we are in an or group locate the first or that can
1084
succeed. We have already cached this.. */
1085
for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; --Ors)
1087
if (Ors == 1 && (DepState[Start->ID] &DepCVer) != DepCVer && Start.IsNegative() == false)
1089
if(DebugAutoInstall == true)
1090
std::clog << OutputInDepth(Depth) << Start << " can't be satisfied!" << std::endl;
1091
if (Start.IsCritical() == false)
1093
// if the dependency was critical, we can't install it, so remove it again
1094
MarkDelete(Pkg,false,Depth + 1, false);
1093
1098
/* Check if any ImportantDep() (but not Critical) were added
1094
1099
* since we installed the package. Also check for deps that
1095
1100
* were satisfied in the past: for instance, if a version
1097
1102
* package should follow that Recommends rather than causing the
1098
1103
* dependency to be removed. (bug #470115)
1100
bool isNewImportantDep = false;
1101
bool isPreviouslySatisfiedImportantDep = false;
1102
if(!ForceImportantDeps && !Start.IsCritical())
1105
if (Pkg->CurrentVer != 0 && ForceImportantDeps == false && Start.IsCritical() == false)
1105
VerIterator instVer = Pkg.CurrentVer();
1108
for (DepIterator D = instVer.DependsList(); D.end() != true; D++)
1110
//FIXME: deal better with or-groups(?)
1111
if(IsImportantDep(D) && !D.IsCritical() &&
1112
Start.TargetPkg() == D.TargetPkg())
1114
if(!isPreviouslySatisfiedImportantDep)
1117
while((D2->CompareOp & Dep::Or) != 0)
1120
isPreviouslySatisfiedImportantDep =
1121
(((*this)[D2] & DepGNow) != 0);
1127
// this is a new dep if it was not found to be already
1128
// a important dep of the installed pacakge
1129
isNewImportantDep = !found;
1107
bool isNewImportantDep = true;
1108
bool isPreviouslySatisfiedImportantDep = false;
1109
for (DepIterator D = Pkg.CurrentVer().DependsList(); D.end() != true; ++D)
1111
//FIXME: Should we handle or-group better here?
1112
// We do not check if the package we look for is part of the same or-group
1113
// we might find while searching, but could that really be a problem?
1114
if (D.IsCritical() == true || IsImportantDep(D) == false ||
1115
Start.TargetPkg() != D.TargetPkg())
1118
isNewImportantDep = false;
1120
while ((D->CompareOp & Dep::Or) != 0)
1123
isPreviouslySatisfiedImportantDep = (((*this)[D] & DepGNow) != 0);
1124
if (isPreviouslySatisfiedImportantDep == true)
1128
if(isNewImportantDep == true)
1130
if (DebugAutoInstall == true)
1131
std::clog << OutputInDepth(Depth) << "new important dependency: "
1132
<< Start.TargetPkg().FullName() << std::endl;
1134
else if(isPreviouslySatisfiedImportantDep == true)
1136
if (DebugAutoInstall == true)
1137
std::clog << OutputInDepth(Depth) << "previously satisfied important dependency on "
1138
<< Start.TargetPkg().FullName() << std::endl;
1142
if (DebugAutoInstall == true)
1143
std::clog << OutputInDepth(Depth) << "ignore old unsatisfied important dependency on "
1144
<< Start.TargetPkg().FullName() << std::endl;
1132
if(isNewImportantDep)
1133
if(DebugAutoInstall == true)
1134
std::clog << OutputInDepth(Depth) << "new important dependency: "
1135
<< Start.TargetPkg().Name() << std::endl;
1136
if(isPreviouslySatisfiedImportantDep)
1137
if(DebugAutoInstall == true)
1138
std::clog << OutputInDepth(Depth) << "previously satisfied important dependency on "
1139
<< Start.TargetPkg().Name() << std::endl;
1141
// skip important deps if the package is already installed
1142
if (Pkg->CurrentVer != 0 && Start.IsCritical() == false
1143
&& !isNewImportantDep && !isPreviouslySatisfiedImportantDep
1144
&& !ForceImportantDeps)
1147
/* If we are in an or group locate the first or that can
1148
succeed. We have already cached this.. */
1149
for (; Ors > 1 && (DepState[Start->ID] & DepCVer) != DepCVer; Ors--)
1152
1149
/* This bit is for processing the possibilty of an install/upgrade
1153
1150
fixing the problem */