#include <apt-pkg/algorithms.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/tagfile.h>
return false;
}
-std::string OutputInDepth(const unsigned long Depth)
-{
- std::string output = "";
- for(unsigned long d=Depth; d > 0; d--)
- output += " ";
- return output;
-}
-
pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) :
cache(cache), released(false)
{
}
}
- if (InstPkg.end() == false)
+ if (InstPkg.end() == false &&
+ AutoInstOk(InstPkg, (*this)[InstPkg].CandidateVerIter(*this), Start))
{
if(DebugAutoInstall == true)
std::clog << OutputInDepth(Depth) << "Installing " << InstPkg.Name()
PkgIterator Pkg = Ver.ParentPkg();
if (Start->Type != Dep::DpkgBreaks)
- MarkDelete(Pkg,false,Depth + 1);
+ {
+ if(AutoInstOk(Pkg, VerIterator(*this), Start))
+ MarkDelete(Pkg);
+ }
else
- if (PkgState[Pkg->ID].CandidateVer != *I)
+ if (PkgState[Pkg->ID].CandidateVer != *I &&
+ AutoInstOk(Pkg, VerIterator(*this, PkgState[Pkg->ID].CandidateVer), Start))
MarkInstall(Pkg,true,Depth + 1, false, ForceImportantDeps);
}
continue;
}
}
}
+
+// DepCache::AutoInstOk - check if it is to install this package /*{{{*/
+// ---------------------------------------------------------------------
+/* The default implementation just honors dpkg hold
+ But an application using this library can override this method
+ to control the MarkInstall behaviour */
+bool pkgDepCache::AutoInstOk(const PkgIterator &Pkg,
+ const VerIterator &v,
+ const DepIterator &d)
+{
+ return (Pkg->SelectedState != pkgCache::State::Hold);
+}
/*}}}*/
// DepCache::SetReInstall - Set the reinstallation flag /*{{{*/
// ---------------------------------------------------------------------