[Aptitude-devel] r3205 - in branches/aptitude-0.3/aptitude: . src/cmdline

Daniel Burrows dburrows@costa.debian.org
Sat, 30 Apr 2005 19:15:47 +0000


Author: dburrows
Date: Sat Apr 30 19:15:44 2005
New Revision: 3205

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_action.cc
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_common.h
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_prompt.cc
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_resolver.cc
Log:
Add a 'keep' action to the command-line prompts.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Apr 30 19:15:44 2005
@@ -1,5 +1,10 @@
 2005-04-30  Daniel Burrows  <dburrows@debian.org>
 
+	* src/cmdline/cmdline_action.cc, src/cmdline/cmdline_common.h, src/cmdline/cmdline_do_action.cc, src/cmdline/cmdline_prompt.cc, src/cmdline/cmdline_resolver.cc:
+
+	  Add a 'keep' action (invoked via ':') to the command-line
+	  prompts.
+
 	* src/cmdline/cmdline_action.cc, src/cmdline/cmdline_action.h, src/cmdline/cmdline_do_action.cc, src/cmdline/cmdline_prompt.cc, src/cmdline/cmdline_resolver.cc, src/cmdline/cmdline_resolver.h:
 
 	  Add support for modifying package states from the resolver

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_action.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_action.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_action.cc	Sat Apr 30 19:15:44 2005
@@ -113,6 +113,12 @@
     case cmdline_hold:
       to_hold.insert(pkg);
       break;
+    case cmdline_keep:
+      to_install.erase(pkg);
+      to_remove.erase(pkg);
+      to_purge.erase(pkg);
+      to_hold.erase(pkg);
+      break;
     case cmdline_unhold:
       to_hold.erase(pkg);
       break;
@@ -147,6 +153,9 @@
     case cmdline_hold:
       (*apt_cache_file)->mark_keep(pkg, false, true, NULL);
       break;
+    case cmdline_keep:
+      (*apt_cache_file)->mark_keep(pkg, false, false, NULL);
+      break;
     case cmdline_unhold:
       if(pkg->CurrentState==pkgCache::State::Installed)
 	(*apt_cache_file)->mark_install(pkg, true, false, NULL);
@@ -371,6 +380,9 @@
     case '+':
       action=cmdline_install;
       break;
+    case ':':
+      action=cmdline_keep;
+      break;
     default:
       printf(_("Bad action character '%c'\n"), s[0]);
       return;

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_common.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_common.h	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_common.h	Sat Apr 30 19:15:44 2005
@@ -24,7 +24,7 @@
 enum cmdline_pkgaction_type
   {cmdline_install, cmdline_remove, cmdline_purge, cmdline_hold,
    cmdline_unhold, cmdline_markauto, cmdline_unmarkauto,
-   cmdline_forbid_version, cmdline_reinstall};
+   cmdline_forbid_version, cmdline_reinstall, cmdline_keep};
 
 enum cmdline_version_source {cmdline_version_cand,
 			     cmdline_version_archive,

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc	Sat Apr 30 19:15:44 2005
@@ -159,6 +159,10 @@
 	    action=cmdline_purge;
 	    argv[i][tmp]=0;
 	    break;
+	  case ':':
+	    action=cmdline_keep;
+	    argv[i][tmp]=0;
+	    break;
 	  }
 
       cmdline_applyaction(argv[i], action,

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_prompt.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_prompt.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_prompt.cc	Sat Apr 30 19:15:44 2005
@@ -649,6 +649,7 @@
 		case '-':
 		case '=':
 		case '_':
+		case ':':
 		  cmdline_parse_action(response, to_install, to_hold,
 				       to_remove, to_purge, verbose);
 		  break;
@@ -675,10 +676,11 @@
 			   "additional actions; each will be applied to all packages that follow it)\n"
 			   "\n"
 			   "Actions:\n"
-			   "  + : Install\n"
-			   "  - : Remove\n"
-			   "  _ : Purge\n"
-			   "  = : Hold\n"));
+			   "  '+' : Install\n"
+			   "  '-' : Remove\n"
+			   "  '_' : Purge\n"
+			   "  '=' : Hold\n"
+			   "  ':' : Keep\n"));
 		  break;
 		default:
 		  printf(_("Invalid response.  Please enter a valid command or '?' for help.\n"));

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_resolver.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_resolver.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_resolver.cc	Sat Apr 30 19:15:44 2005
@@ -96,6 +96,7 @@
 					"%F"
 					"%F"
 					"%F"
+					"%F"
 					"%F"),
 				      flowindentbox(0, 3,
 						fragf(_("accept the proposed changes"))),
@@ -116,7 +117,9 @@
 				      flowindentbox(0, 4,
 						    fragf(_("'_' to purge packages"))),
 				      flowindentbox(0, 4,
-						    fragf(_("'=' to hold packages"))),
+						    fragf(_("'=' to place packages on hold"))),
+				      flowindentbox(0, 4,
+						    fragf(_("':' to keep packages in their current state without placing them on hold"))),
 				      flowindentbox(0, 3,
 						    fragf(_("Adjustments will cause the current solution to be discarded and recalculated as necessary."))))));
 
@@ -212,6 +215,7 @@
 		  case '-':
 		  case '=':
 		  case '_':
+		  case ':':
 		    cmdline_parse_action(response, to_install, to_hold,
 					 to_remove, to_purge, verbose);
 		    modified_pkgs=true;