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

* merged with ubuntu, only use the pkgCache::Flag::Auto flag for automatically installed packages

Patches applied:

 * apt@packages.debian.org/apt--main--0--patch-98
   Install only one keyring on each branch (Closes: #316119)

 * apt@packages.debian.org/apt--main--0--patch-99
   Finalize 0.6.39

 * apt@packages.debian.org/apt--ubuntu--0--patch-7
   Merge with mainline

 * apt@packages.debian.org/apt--ubuntu--0--patch-8
   install only the ubuntu keyring

 * apt@packages.debian.org/apt--ubuntu--0--patch-9
   Finalize 0.6.39

 * apt@packages.debian.org/apt--ubuntu--0--patch-10
   Merge with mainline

 * apt@packages.debian.org/apt--ubuntu--0--patch-11
   Update configure.in
Michael Vogt лет назад: 21
Родитель
Сommit
e23e673308
6 измененных файлов с 33 добавлено и 58 удалено
  1. 1 1
      apt-pkg/algorithms.cc
  2. 9 16
      apt-pkg/depcache.cc
  3. 0 7
      apt-pkg/depcache.h
  4. 4 3
      apt-pkg/packagemanager.h
  5. 18 30
      debian/changelog
  6. 1 1
      debian/rules

+ 1 - 1
apt-pkg/algorithms.cc

@@ -1349,7 +1349,7 @@ bool pkgMarkUsed(pkgDepCache &Cache)
    // do the mark part
    // do the mark part
    for(pkgCache::PkgIterator p=Cache.PkgBegin(); !p.end(); ++p)
    for(pkgCache::PkgIterator p=Cache.PkgBegin(); !p.end(); ++p)
    {
    {
-      if(Cache[p].InstallReason==pkgDepCache::Manual ||
+      if(!(Cache[p].Flags & pkgCache::Flag::Auto) ||
 	 (p->Flags & pkgCache::Flag::Essential))
 	 (p->Flags & pkgCache::Flag::Essential))
       {
       {
 	 if(Cache[p].Keep() && !p.CurrentVer().end())
 	 if(Cache[p].Keep() && !p.CurrentVer().end())

+ 9 - 16
apt-pkg/depcache.cc

@@ -78,7 +78,6 @@ bool pkgDepCache::Init(OpProgress *Prog)
       // Find the proper cache slot
       // Find the proper cache slot
       StateCache &State = PkgState[I->ID];
       StateCache &State = PkgState[I->ID];
       State.iFlags = 0;
       State.iFlags = 0;
-      State.InstallReason = Manual;
 
 
       // Figure out the install version
       // Figure out the install version
       State.CandidateVer = GetCandidateVer(I);
       State.CandidateVer = GetCandidateVer(I);
@@ -125,8 +124,9 @@ bool pkgDepCache::readStateFile(OpProgress *Prog)
 	 // Silently ignore unknown packages and packages with no actual
 	 // Silently ignore unknown packages and packages with no actual
 	 // version.
 	 // version.
 	 if(!pkg.end() && !pkg.VersionList().end()) {
 	 if(!pkg.end() && !pkg.VersionList().end()) {
-	    short reason = section.FindI("Install-Reason",pkgDepCache::Manual);
-	    PkgState[pkg->ID].InstallReason = (ChangedReason)reason;
+	    short reason = section.FindI("Install-Reason", 0);
+	    if(reason > 0)
+	       PkgState[pkg->ID].Flags  |= pkgCache::Flag::Auto;
 	    if(_config->FindB("Debug::pkgAutoRemove",false))
 	    if(_config->FindB("Debug::pkgAutoRemove",false))
 	       std::cout << "Install-Reason for: " << pkgname 
 	       std::cout << "Install-Reason for: " << pkgname 
 			 << " is " << reason << std::endl;
 			 << " is " << reason << std::endl;
@@ -147,6 +147,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog)
    FileFd StateFile;
    FileFd StateFile;
    string state = _config->FindDir("Dir::State") + "pkgstates";
    string state = _config->FindDir("Dir::State") + "pkgstates";
 
 
+   if(_config->FindB("Debug::pkgAutoRemove",false))
+      std::clog << "pkgDepCache::writeStateFile()" << std::endl;
+
    if(!StateFile.Open(state, FileFd::WriteEmpty))
    if(!StateFile.Open(state, FileFd::WriteEmpty))
       return _error->Error(_("Failed to write StateFile %s"),
       return _error->Error(_("Failed to write StateFile %s"),
 			   state.c_str());
 			   state.c_str());
@@ -154,22 +157,12 @@ bool pkgDepCache::writeStateFile(OpProgress *prog)
    std::ostringstream ostr;
    std::ostringstream ostr;
    for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end();pkg++) {
    for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end();pkg++) {
 
 
-      // clear out no longer installed pkg
-      if(PkgState[pkg->ID].Delete() || pkg.CurrentVer() == NULL) 
-	 PkgState[pkg->ID].InstallReason = Manual;
-
-      // check if we have new information
       if(PkgState[pkg->ID].Flags & pkgCache::Flag::Auto) {
       if(PkgState[pkg->ID].Flags & pkgCache::Flag::Auto) {
-	 if(_config->FindI("Debug::pkgAutoRemove",false))
-	    std::clog << "pkg: " << pkg.Name() << " is auto-dep" << std::endl;
-	 PkgState[pkg->ID].InstallReason = Libapt;
-      }
-
-      if(PkgState[pkg->ID].InstallReason != Manual) {
+	 if(_config->FindB("Debug::pkgAutoRemove",false))
+	    std::clog << "AutoInstal: " << pkg.Name() << std::endl;
 	 ostr.str(string(""));
 	 ostr.str(string(""));
 	 ostr << "Package: " << pkg.Name() 
 	 ostr << "Package: " << pkg.Name() 
-	      << "\nInstall-Reason: "
-	      << (int)(PkgState[pkg->ID].InstallReason) << "\n\n";
+	      << "\nInstall-Reason: 1\n\n";
 	 StateFile.Write(ostr.str().c_str(), ostr.str().size());
 	 StateFile.Write(ostr.str().c_str(), ostr.str().size());
       }
       }
    }
    }

+ 0 - 7
apt-pkg/depcache.h

@@ -64,9 +64,6 @@ class pkgDepCache : protected pkgCache::Namespace
    enum VersionTypes {NowVersion, InstallVersion, CandidateVersion};
    enum VersionTypes {NowVersion, InstallVersion, CandidateVersion};
    enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2};
    enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2};
 
 
-   // Flags for the GC
-   enum ChangedReason {Manual, UserAuto, Libapt, FromResolver, PkgIsUnused};
-
    struct StateCache
    struct StateCache
    {
    {
       // Epoch stripped text versions of the two version fields
       // Epoch stripped text versions of the two version fields
@@ -84,10 +81,6 @@ class pkgDepCache : protected pkgCache::Namespace
       unsigned short iFlags;           // Internal flags
       unsigned short iFlags;           // Internal flags
 
 
       // mark and sweep flags
       // mark and sweep flags
-      ChangedReason InstallReason;
-#if 0
-      ChangedReason RemoveReason;
-#endif
       bool Marked;
       bool Marked;
       bool Garbage;
       bool Garbage;
 
 

+ 4 - 3
apt-pkg/packagemanager.h

@@ -28,6 +28,7 @@
 #endif
 #endif
 
 
 #include <string>
 #include <string>
+#include <iostream>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
 
 
@@ -101,11 +102,11 @@ class pkgPackageManager : protected pkgCache::Namespace
       bool goResult = Go(statusFd);
       bool goResult = Go(statusFd);
       if(goResult == false) 
       if(goResult == false) 
 	 return Failed;
 	 return Failed;
-      
+
       // if all was fine update the state file
       // if all was fine update the state file
-      if(Res == Completed)
+      if(Res == Completed) {
 	 Cache.writeStateFile(NULL);
 	 Cache.writeStateFile(NULL);
-
+      }
       return Res;
       return Res;
    };
    };
 
 

+ 18 - 30
debian/changelog

@@ -1,4 +1,18 @@
-apt (0.6.38ubuntu1mvo1) unstable; urgency=low
+apt (0.6.39ubuntu1mvo1) unstable; urgency=low
+
+  * Michael Vogt
+    - Change debian/bugscript to use #!/bin/bash (Closes: #313402)
+    - Fix a incorrect example in the man-page (closes: #282918)
+    - Support architecture-specific extra overrides
+      (closes: #225947). Thanks to  Anthony Towns for idea and
+      the patch, thanks to Colin Watson for testing it.
+    - better report network timeouts from the methods to the acuire code,
+      only timeout once per sources.list line
+    - support for automatic removal of unused dependencies added
+
+ -- 
+
+apt (0.6.39) unstable; urgency=low
 
 
   * Welsh translation update: daf@muse.19inch.net--2005/apt--main--0--patch-6
   * Welsh translation update: daf@muse.19inch.net--2005/apt--main--0--patch-6
   * Merge mvo's changes from 0.6.36ubuntu1:
   * Merge mvo's changes from 0.6.36ubuntu1:
@@ -6,19 +20,9 @@ apt (0.6.38ubuntu1mvo1) unstable; urgency=low
   * Merge aggregated translation updates:
   * Merge aggregated translation updates:
     bubulle@debian.org--2005/apt--main--0
     bubulle@debian.org--2005/apt--main--0
   * Update priority of apt-utils to important, to match the override file
   * Update priority of apt-utils to important, to match the override file
-  * Michael Vogt
-    - Change debian/bugscript to use #!/bin/bash (Closes: #313402)
-    - Fix a incorrect example in the man-page (closes: #282918)
-    - Support architecture-specific extra overrides 
-      (closes: #225947). Thanks to  Anthony Towns for idea and 
-      the patch, thanks to Colin Watson for testing it.
-    - better report network timeouts from the methods to the acuire code, 
-      only timeout once per sources.list line 
-    - started to port the great automatic dependency mangement code from
-      aptitude over to apt (thanks dburrows for answering my silly 
-      questions and your great help!)
-  
- -- 
+  * Install only one keyring on each branch (Closes: #316119)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 28 Jun 2005 11:35:21 -0700
 
 
 apt (0.6.38ubuntu1) breezy; urgency=low
 apt (0.6.38ubuntu1) breezy; urgency=low
 
 
@@ -42,22 +46,6 @@ apt (0.6.38) unstable; urgency=low
   
   
  -- Matt Zimmerman <mdz@debian.org>  Sat, 25 Jun 2005 09:51:00 -0700
  -- Matt Zimmerman <mdz@debian.org>  Sat, 25 Jun 2005 09:51:00 -0700
 
 
-apt (0.6.38) unstable; urgency=low
-
-  * Merge michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-6, a workaround
-    for the French man pages' failure to build
-  * Branch Debian and Ubuntu
-    - apt.postinst, apt-key: use the appropriate keyring
-    - debian/rules: install all keyrings
-  * Add the current Debian archive signing key (4F368D5D) to
-    debian-archive.gpg
-  * make pinning on the "component" work again (using the section of the 
-    archive, we don't use per-section Release files anymore with apt-0.6)
-    (closes ubuntu #9935)
-  
- -- Matt Zimmerman <mdz@debian.org>  Sat, 25 Jun 2005 09:51:00 -0700
-
->>>>>>> MERGE-SOURCE
 apt (0.6.37) breezy; urgency=low
 apt (0.6.37) breezy; urgency=low
 
 
   * Merge bubulle@debian.org--2005/apt--main--0 up to patch-81
   * Merge bubulle@debian.org--2005/apt--main--0 up to patch-81

+ 1 - 1
debian/rules

@@ -209,7 +209,7 @@ apt: build debian/shlibs.local
 
 
 	cp debian/bugscript debian/$@/usr/share/bug/apt/script
 	cp debian/bugscript debian/$@/usr/share/bug/apt/script
 
 
-	cp share/*.gpg debian/$@/usr/share/$@
+	cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
 
 
 #	head -n 500 ChangeLog > debian/ChangeLog
 #	head -n 500 ChangeLog > debian/ChangeLog