]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp.cc
refer to apt-secure(8) in unsecure repositories warning
[apt.git] / apt-pkg / edsp.cc
index 34b0b0cc7fdc9c72fe9131a1999b69587d25c2d8..90f20472e255100caf2063ed77010fb076da4983 100644 (file)
@@ -7,31 +7,25 @@
 // Include Files                                                       /*{{{*/
 #include <config.h>
 
 // Include Files                                                       /*{{{*/
 #include <config.h>
 
-#include <apt-pkg/edsp.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/cacheset.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/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/strutl.h>
-#include <apt-pkg/pkgrecords.h>
 
 #include <ctype.h>
 #include <stddef.h>
 #include <string.h>
 
 #include <ctype.h>
 #include <stddef.h>
 #include <string.h>
-#include <time.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <algorithm>
 #include <iostream>
 #include <iostream>
-#include <vector>
 #include <limits>
 #include <string>
 #include <limits>
 #include <string>
-#include <list>
 
 #include <apti18n.h>
                                                                        /*}}}*/
 
 #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: %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 ||
    if (Pkg.CurrentVer() == Ver)
       fprintf(output, "Installed: yes\n");
    if (Pkg->SelectedState == pkgCache::State::Hold ||
@@ -106,7 +101,7 @@ static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &
         continue;
       if (orGroup == false)
         dependencies[Dep->Type].append(", ");
         continue;
       if (orGroup == false)
         dependencies[Dep->Type].append(", ");
-      dependencies[Dep->Type].append(Dep.TargetPkg().FullName((Dep->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific));
+      dependencies[Dep->Type].append(Dep.TargetPkg().Name());
       if (Dep->Version != 0)
         dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
       if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
       if (Dep->Version != 0)
         dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
       if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
@@ -156,7 +151,7 @@ static void WriteScenarioLimitedDependency(FILE* output,
         orGroup = false;
         continue;
       }
         orGroup = false;
         continue;
       }
-      dependencies[Dep->Type].append(Dep.TargetPkg().FullName((Dep->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific));
+      dependencies[Dep->Type].append(Dep.TargetPkg().Name());
       if (Dep->Version != 0)
         dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
       if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
       if (Dep->Version != 0)
         dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")");
       if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or)
@@ -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")
                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") {
                else if (type == "Remove")
                        Cache.MarkDelete(Ver.ParentPkg(), false);
                else if (type == "Autoremove") {