Browse Source

make the specify order of packages irrelevant (half-close #196021)

tags/debian/0.8.0
David Kalnischkies 11 years ago
parent
commit
6806db8ac0
2 changed files with 19 additions and 5 deletions
  1. +18
    -5
      cmdline/apt-get.cc
  2. +1
    -0
      debian/changelog

+ 18
- 5
cmdline/apt-get.cc View File

@@ -762,6 +762,7 @@ struct TryToInstall {
pkgProblemResolver* Fix;
bool FixBroken;
unsigned long AutoMarkChanged;
APT::PackageSet doAutoInstallLater;

TryToInstall(pkgCacheFile &Cache, pkgProblemResolver &PM, bool const &FixBroken) : Cache(&Cache), Fix(&PM),
FixBroken(FixBroken), AutoMarkChanged(0) {};
@@ -769,8 +770,6 @@ struct TryToInstall {
void operator() (pkgCache::VerIterator const &Ver) {
pkgCache::PkgIterator Pkg = Ver.ParentPkg();

std::clog << "INSTALL " << Pkg << " VER " << Ver.VerStr() << std::endl;

Cache->GetDepCache()->SetCandidateVersion(Ver);
pkgDepCache::StateCache &State = (*Cache)[Pkg];

@@ -801,8 +800,8 @@ std::clog << "INSTALL " << Pkg << " VER " << Ver.VerStr() << std::endl;

// Install it with autoinstalling enabled (if we not respect the minial
// required deps or the policy)
if ((State.InstBroken() == true || State.InstPolicyBroken() == true) && FixBroken == false)
Cache->GetDepCache()->MarkInstall(Pkg,true);
if (FixBroken == false)
doAutoInstallLater.insert(Pkg);
}

// see if we need to fix the auto-mark flag
@@ -820,6 +819,17 @@ std::clog << "INSTALL " << Pkg << " VER " << Ver.VerStr() << std::endl;
AutoMarkChanged++;
}
}

void doAutoInstall() {
for (APT::PackageSet::const_iterator P = doAutoInstallLater.begin();
P != doAutoInstallLater.end(); ++P) {
pkgDepCache::StateCache &State = (*Cache)[P];
if (State.InstBroken() == false && State.InstPolicyBroken() == false)
continue;
Cache->GetDepCache()->MarkInstall(P, true);
}
doAutoInstallLater.clear();
}
};
/*}}}*/
// TryToRemove - Mark a package for removal /*{{{*/
@@ -1336,6 +1346,7 @@ bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache,
} else if (Cache[Pkg].CandidateVer != 0) {
TryToInstall InstallAction(Cache, Fix, BrokenFix);
InstallAction(Cache[Pkg].CandidateVerIter(Cache));
InstallAction.doAutoInstall();
} else
return AllowFail;

@@ -1743,8 +1754,10 @@ bool DoInstall(CommandLine &CmdL)

for (unsigned short i = 0; order[i] != 0; ++i)
{
if (order[i] == MOD_INSTALL)
if (order[i] == MOD_INSTALL) {
InstallAction = std::for_each(verset[MOD_INSTALL].begin(), verset[MOD_INSTALL].end(), InstallAction);
InstallAction.doAutoInstall();
}
else if (order[i] == MOD_REMOVE)
RemoveAction = std::for_each(verset[MOD_REMOVE].begin(), verset[MOD_REMOVE].end(), RemoveAction);
}


+ 1
- 0
debian/changelog View File

@@ -10,6 +10,7 @@ apt (0.7.26~exp8) UNRELEASED; urgency=low
- check in Grouped* first without modifier interpretation
* cmdline/apt-get.cc:
- use the cachsets in the install commands
- make the specify order of packages irrelevant (half-close #196021)
* apt-pkg/orderlist.cc:
- untouched packages are never missing
* apt-pkg/packagemanager.cc:


Loading…
Cancel
Save