X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4dc77823d360158d6870a5710cc8c17064f1308f..1dd20368486820efb6ef4476ad739e967174bec4:/apt-pkg/edsp.cc?ds=sidebyside

diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 5c53581fe..bf625cc97 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -7,31 +7,25 @@
 // Include Files							/*{{{*/
 #include <config.h>
 
-#include <apt-pkg/edsp.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/cacheset.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/tagfile.h>
-#include <apt-pkg/fileutl.h>
-#include <apt-pkg/progress.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/edsp.h>
+#include <apt-pkg/tagfile.h>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/pkgrecords.h>
 
 #include <ctype.h>
 #include <stddef.h>
 #include <string.h>
-#include <time.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <algorithm>
 #include <iostream>
-#include <vector>
 #include <limits>
 #include <string>
-#include <list>
 
 #include <apti18n.h>
 									/*}}}*/
@@ -54,6 +48,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg
    fprintf(output, "Source: %s\n", Ver.SourcePkgName());
    fprintf(output, "Architecture: %s\n", Ver.Arch());
    fprintf(output, "Version: %s\n", Ver.VerStr());
+   fprintf(output, "Source-Version: %s\n", Ver.SourceVerStr());
    if (Pkg.CurrentVer() == Ver)
       fprintf(output, "Installed: yes\n");
    if (Pkg->SelectedState == pkgCache::State::Hold ||
@@ -89,7 +84,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg
 	   fprintf(output, " %s\n", R->c_str());
    }
    fprintf(output, "APT-Pin: %d\n", Pin);
-   if (Cache.GetCandidateVer(Pkg) == Ver)
+   if (Cache.GetCandidateVersion(Pkg) == Ver)
       fprintf(output, "APT-Candidate: yes\n");
    if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto)
       fprintf(output, "APT-Automatic: yes\n");
@@ -102,7 +97,7 @@ static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &
    bool orGroup = false;
    for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep)
    {
-      if (Dep.IsMultiArchImplicit() == true)
+      if (Dep.IsImplicit() == true)
 	 continue;
       if (orGroup == false)
 	 dependencies[Dep->Type].append(", ");
@@ -140,7 +135,7 @@ static void WriteScenarioLimitedDependency(FILE* output,
    bool orGroup = false;
    for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep)
    {
-      if (Dep.IsMultiArchImplicit() == true)
+      if (Dep.IsImplicit() == true)
 	 continue;
       if (orGroup == false)
       {
@@ -348,7 +343,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres
 		pkgCache::VerIterator Ver(Cache.GetCache(), Cache.GetCache().VerP + VerIdx[id]);
 		Cache.SetCandidateVersion(Ver);
 		if (type == "Install")
-			Cache.MarkInstall(Ver.ParentPkg(), false, 0, false);
+		{
+			pkgCache::PkgIterator const P = Ver.ParentPkg();
+			if (Cache[P].Mode != pkgDepCache::ModeInstall)
+				Cache.MarkInstall(P, false, 0, false);
+		}
 		else if (type == "Remove")
 			Cache.MarkDelete(Ver.ParentPkg(), false);
 		else if (type == "Autoremove") {
@@ -511,9 +510,10 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output)
       }
       else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true)
       {
-	 fprintf(output, "Install: %d\n", Cache.GetCandidateVer(Pkg)->ID);
+	 pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg);
+	 fprintf(output, "Install: %d\n", CandVer->ID);
 	 if (Debug == true)
-	    fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Cache.GetCandidateVer(Pkg).VerStr());
+	    fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr());
       }
       else if (Cache[Pkg].Garbage == true)
       {