[Aptitude-svn-commit] r3713 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Sat Aug 6 02:03:03 UTC 2005


Author: dburrows
Date: Sat Aug  6 02:02:59 2005
New Revision: 3713

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/aptcache.cc
Log:
Always save the version to be installed, not just when su-ing.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Aug  6 02:02:59 2005
@@ -1,5 +1,13 @@
 2005-08-05  Daniel Burrows  <dburrows at debian.org>
 
+	* src/generic/aptcache.cc:
+
+	  Always save the version to be installed, so long as it's a
+	  change from the current version but not the same as the default
+	  candidate version.  This should handle the problem that the
+	  version to install isn't saved in a reasonably intuitive way.
+	  (Closes: #158711)
+
 	* src/ui.cc:
 
 	  Add canned views to display a flat package list and to display a

Modified: branches/aptitude-0.3/aptitude/src/generic/aptcache.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/aptcache.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/aptcache.cc	Sat Aug  6 02:02:59 2005
@@ -347,16 +347,13 @@
 
 	  // FIXME: should I check this for "unknown" packages as well?
 	  // Does that even make sense??
-	  if(!estate.candver.empty() &&
-	     estate.candver!=state.InstVerIter(GetCache()).VerStr())
+	  if(!estate.candver.empty())
 	    {
 	      for(pkgCache::VerIterator ver=i.VersionList(); !ver.end(); ++ver)
 		if(ver.VerStr()==estate.candver)
-		  {
-		    SetCandidateVersion(ver);
-		    MarkInstall(ver.ParentPkg(), false);
-		    break;
-		  }
+		  SetCandidateVersion(ver);
+
+	      MarkInstall(i, false);
 	    }
 	  else
 	    if(i.CurrentVer().end())
@@ -526,16 +523,17 @@
 	    bool upgrade=(!i.CurrentVer().end()) && state.Install();
 	    string upgradestr=upgrade ? "Upgrade: yes\n" : "";
 
-	    // HACK: only write the version-string if we are writing
-	    //      to a non-default file.  ICKY.  MUST FIX.
-	    string tailstr=status_fname && !estate.candver.empty()
-	      ?"Version: "+estate.candver+"\n":"";
+	    string tailstr;
 
-	    tailstr+="\n";
+	    if(!estate.candver.empty() &&
+	       !i.CurrentVer().end() &&
+	       i.CurrentVer().VerStr() != estate.candver &&
+	       GetCandidateVer(i).VerStr() != estate.candver)
+	      tailstr = "Version: " + estate.candver + "\n";
 
 	    len=snprintf(buf,
 			 400,
-			 "Package: %s\nUnseen: %s\nState: %i\nDselect-State: %i\nLast-Change: %i\nRemove-Reason: %i\n%s%s%s",
+			 "Package: %s\nUnseen: %s\nState: %i\nDselect-State: %i\nLast-Change: %i\nRemove-Reason: %i\n%s%s%s\n",
 			 i.Name(),
 			 estate.new_package?"yes":"no",
 			 estate.selection_state,
@@ -868,10 +866,14 @@
       if(undo)
 	undo->add_item(new candver_undoer(prev, this));
 
+      aptitude_state &estate = get_ext_state(ver.ParentPkg());
+
       if(ver!=GetCandidateVer(ver.ParentPkg()))
-	get_ext_state(ver.ParentPkg()).candver=ver.VerStr();
+	estate.candver=ver.VerStr();
       else
-	get_ext_state(ver.ParentPkg()).candver="";
+	estate.candver="";
+
+      estate.selection_state = pkgCache::State::Install;
 
       SetCandidateVersion(ver);
 



More information about the Aptitude-svn-commit mailing list