Преглед изворни кода

More inproved comments about loops.

Christopher Baines пре 15 година
родитељ
комит
e7ecc2183c
2 измењених фајлова са 9 додато и 1 уклоњено
  1. 2 0
      apt-pkg/orderlist.cc
  2. 7 1
      apt-pkg/orderlist.h

+ 2 - 0
apt-pkg/orderlist.cc

@@ -1023,6 +1023,8 @@ bool pkgOrderList::AddLoop(DepIterator D)
    // Mark the packages as being part of a loop.
    // Mark the packages as being part of a loop.
    //Flag(D.TargetPkg(),Loop);
    //Flag(D.TargetPkg(),Loop);
    //Flag(D.ParentPkg(),Loop);
    //Flag(D.ParentPkg(),Loop);
+   /* This is currently disabled because the Loop flag is being used for
+      loop management in the package manager. Check the orderlist.h file for more info */
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 7 - 1
apt-pkg/orderlist.h

@@ -74,7 +74,12 @@ class pkgOrderList : protected pkgCache::Namespace
 
 
    typedef Package **iterator;
    typedef Package **iterator;
    
    
-   // State flags
+   /* State flags
+      The Loop flag can be set on a package that is currently being processed by either SmartConfigure or
+      SmartUnPack. This allows the package manager to tell when a loop has been formed as it will try to 
+      SmartUnPack or SmartConfigure a package with the Loop flag set. It will then either stop (as it knows
+      that the operation is unnecessary as its already in process), or in the case of the conflicts resolution
+      in SmartUnPack, use EarlyRemove to resolve the situation.  */
    enum Flags {Added = (1 << 0), AddPending = (1 << 1),
    enum Flags {Added = (1 << 0), AddPending = (1 << 1),
                Immediate = (1 << 2), Loop = (1 << 3),
                Immediate = (1 << 2), Loop = (1 << 3),
                UnPacked = (1 << 4), Configured = (1 << 5),
                UnPacked = (1 << 4), Configured = (1 << 5),
@@ -89,6 +94,7 @@ class pkgOrderList : protected pkgCache::Namespace
    void Flag(PkgIterator Pkg,unsigned long State, unsigned long F) {Flags[Pkg->ID] = (Flags[Pkg->ID] & (~F)) | State;};
    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(PkgIterator Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
    inline void Flag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
    inline void Flag(Package *Pkg,unsigned long F) {Flags[Pkg->ID] |= F;};
+   // IsNow will return true if the Pkg has been not been either configured or unpacked
    inline bool IsNow(PkgIterator Pkg) {return (Flags[Pkg->ID] & (States & (~Removed))) == 0;};
    inline bool IsNow(PkgIterator Pkg) {return (Flags[Pkg->ID] & (States & (~Removed))) == 0;};
    bool IsMissing(PkgIterator Pkg);
    bool IsMissing(PkgIterator Pkg);
    void WipeFlags(unsigned long F);
    void WipeFlags(unsigned long F);