Просмотр исходного кода

With the introduction of the Is{Delete,Install}Ok hooks the apt flag
--ignore-hold only works partly: The holds are to strongly enforced
in these hooks - this commit brings the old (and expected) behaviour back.

[apt-pkg/depcache.cc]
- restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks

David Kalnischkies лет назад: 17
Родитель
Сommit
83cb406935
2 измененных файлов с 4 добавлено и 2 удалено
  1. 2 2
      apt-pkg/depcache.cc
  2. 2 0
      debian/changelog

+ 2 - 2
apt-pkg/depcache.cc

@@ -823,7 +823,7 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge,
 bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge,
 bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge,
 			      unsigned long Depth, bool FromUser)
 			      unsigned long Depth, bool FromUser)
 {
 {
-   if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold)
+   if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false)
    {
    {
       if (DebugMarker == true)
       if (DebugMarker == true)
 	 std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl;
 	 std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl;
@@ -1085,7 +1085,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst,
 bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst,
 			      unsigned long Depth, bool FromUser)
 			      unsigned long Depth, bool FromUser)
 {
 {
-   if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold)
+   if (FromUser == false && Pkg->SelectedState == pkgCache::State::Hold && _config->FindB("APT::Ignore-Hold",false) == false)
    {
    {
       if (DebugMarker == true)
       if (DebugMarker == true)
 	 std::clog << OutputInDepth(Depth) << "Hold prevents MarkInstall of " << Pkg << " FU=" << FromUser << std::endl;
 	 std::clog << OutputInDepth(Depth) << "Hold prevents MarkInstall of " << Pkg << " FU=" << FromUser << std::endl;

+ 2 - 0
debian/changelog

@@ -25,6 +25,8 @@ apt (0.7.22.3) unstable; urgency=low
   * ftparchive/writer.cc:
   * ftparchive/writer.cc:
     - add lzma support also here, patch for this (and inspiration for
     - add lzma support also here, patch for this (and inspiration for
       the one above) by Robert Millan, thanks!
       the one above) by Robert Millan, thanks!
+  * apt-pkg/depcache.cc:
+    - restore the --ignore-hold effect in the Is{Delete,Install}Ok hooks
 
 
   [ George Danchev ]
   [ George Danchev ]
   * cmdline/apt-cache.cc:
   * cmdline/apt-cache.cc: