]> git.saurik.com Git - apt.git/commitdiff
Force-LoopBreak
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:34 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:34 +0000 (16:54 +0000)
Author: jgg
Date: 1999-08-12 05:59:47 GMT
Force-LoopBreak

apt-pkg/orderlist.h
apt-pkg/packagemanager.cc
doc/apt.conf.5.yo
doc/examples/apt.conf

index f15db4ce67a3f352c867bfdad6c739de601d08f7..7e1b8efbc9e446dd0d86c52a799f59651ff950f7 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: orderlist.h,v 1.6 1999/08/03 05:19:41 jgg Exp $
+// $Id: orderlist.h,v 1.7 1999/08/12 05:59:54 jgg Exp $
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
@@ -88,7 +88,7 @@ class pkgOrderList
    enum Flags {Added = (1 << 0), AddPending = (1 << 1),
                Immediate = (1 << 2), Loop = (1 << 3),
                UnPacked = (1 << 4), Configured = (1 << 5),
    enum Flags {Added = (1 << 0), AddPending = (1 << 1),
                Immediate = (1 << 2), Loop = (1 << 3),
                UnPacked = (1 << 4), Configured = (1 << 5),
-               Removed = (1 << 6),
+               Removed = (1 << 6),        // Early Remove
                InList = (1 << 7),
                States = (UnPacked | Configured | Removed)};
 
                InList = (1 << 7),
                States = (UnPacked | Configured | Removed)};
 
@@ -98,7 +98,7 @@ class pkgOrderList
    void Flag(PkgIterator Pkg,unsigned long State, unsigned long F) {Flags[Pkg->ID] = (Flags[Pkg->ID] & (~F)) | State;};
    inline void Flag(PkgIterator Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
    inline void Flag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
    void Flag(PkgIterator Pkg,unsigned long State, unsigned long F) {Flags[Pkg->ID] = (Flags[Pkg->ID] & (~F)) | State;};
    inline void Flag(PkgIterator Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
    inline void Flag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
-   inline bool IsNow(PkgIterator Pkg) {return (Flags[Pkg->ID] & States) == 0;};
+   inline bool IsNow(PkgIterator Pkg) {return (Flags[Pkg->ID] & (States & (~Removed))) == 0;};
    bool IsMissing(PkgIterator Pkg);
    void WipeFlags(unsigned long F);
    void SetFileList(string *FileList) {this->FileList = FileList;};
    bool IsMissing(PkgIterator Pkg);
    void WipeFlags(unsigned long F);
    void SetFileList(string *FileList) {this->FileList = FileList;};
index 68827f53c197ed08ef75f3b19fd6083d51edc088..28a8d7fb264649bdcf582ff2407dd92033feadd2 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: packagemanager.cc,v 1.19 1999/08/03 05:19:41 jgg Exp $
+// $Id: packagemanager.cc,v 1.20 1999/08/12 05:59:54 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -364,6 +364,17 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
    // Woops, it will not be re-installed!
    if (List->IsFlag(Pkg,pkgOrderList::InList) == false)
       return false;
    // Woops, it will not be re-installed!
    if (List->IsFlag(Pkg,pkgOrderList::InList) == false)
       return false;
+
+   // Essential packages get special treatment
+   if ((Pkg->Flags & pkgCache::Flag::Essential) != 0)
+   {
+      if (_config->FindB("APT::Force-LoopBreak",false) == false)
+        return _error->Error("This installation run will require temporarily "
+                             "removing the essential package %s due to a "
+                             "Conflicts/Pre-Depends loop. This is often bad, "
+                             "but if you really want to do it, activate the "
+                             "APT::Force-LoopBreak option.",Pkg.Name());
+   }
    
    bool Res = SmartRemove(Pkg);
    if (Cache[Pkg].Delete() == false)
    
    bool Res = SmartRemove(Pkg);
    if (Cache[Pkg].Delete() == false)
index 9be4b114aa9c6ba8e232cc30cb92b6ff7112a410..923e2724ec688fb2b2df3aa392c9da22df90a186 100644 (file)
@@ -62,6 +62,14 @@ so may be necessary on some extremely slow single user systems but
 is very dangerous and may cause package install scripts to fail or worse.
 Use at your own risk.
 
 is very dangerous and may cause package install scripts to fail or worse.
 Use at your own risk.
 
+dit(bf(Force-LoopBreak))
+Never Enable this option unless you -really- know what you are doing. It
+permits APT to temporarily remove an essential package to break a
+Conflicts/Conflicts or Conflicts/Pre-Depend loop between two essential
+packages. SUCH A LOOP SHOULD NEVER EXIST AND IS A GRAVE BUG. This option will
+work if the essential packages are not tar, gzip, libc, bash or anything that 
+those packages depend on.
+
 dit(bf(Get))
 The Get subsection controls the bf(apt-get(8)) tool, please see its
 documentation for more information about the options here.
 dit(bf(Get))
 The Get subsection controls the bf(apt-get(8)) tool, please see its
 documentation for more information about the options here.
index a84fc1079fe0e531c6b415df0a4d59cca4ca3fa8..955088768a94770ddfc1c36532bf7409be8e7d7f 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.35 1999/08/05 05:56:25 jgg Exp $
+// $Id: apt.conf,v 1.36 1999/08/12 05:59:47 jgg Exp $
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    valid file.
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    valid file.
@@ -54,6 +54,7 @@ APT
   // Some general options
   Ignore-Hold "false";
   Immediate-Configure "true";      // DO NOT turn this off, see the man page
   // Some general options
   Ignore-Hold "false";
   Immediate-Configure "true";      // DO NOT turn this off, see the man page
+  Force-LoopBreak "false";         // DO NOT turn this on, see the man page
 };
 
 // Options for the downloading routines
 };
 
 // Options for the downloading routines