]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp.cc
implement apt-get source msg 'Please use: $vcs' for git
[apt.git] / apt-pkg / edsp.cc
index aea6f3a5dee941c8b4e1c630526bda772d39c455..90f20472e255100caf2063ed77010fb076da4983 100644 (file)
@@ -48,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 ||
@@ -100,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)
@@ -150,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)
@@ -342,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") {