瀏覽代碼

* apt-pkg/depcache.cc:
- never autoremove Required packages

Michael Vogt 19 年之前
父節點
當前提交
c04a8d16e2
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      apt-pkg/depcache.cc

+ 5 - 0
apt-pkg/depcache.cc

@@ -1345,6 +1345,11 @@ bool pkgDepCache::Sweep()
   {
      StateCache &state=PkgState[p->ID];
 
+     // skip required packages
+     if (!p.CurrentVer().end() && 
+	 (p.CurrentVer()->Priority == pkgCache::State::Required))
+	continue;
+
      // if it is not marked and it is installed, it's garbage 
      if(!state.Marked && (!p.CurrentVer().end() || state.Install()))
      {