- support task removal too: apt-get remove taskname^
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 18 Jul 2007 11:33:36 +0000 (12:33 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 18 Jul 2007 11:33:36 +0000 (12:33 +0100)
    (thanks to Matt Zimmerman reporting this problem)

cmdline/apt-get.cc
debian/changelog

index 95600ff..df04140 100644 (file)
@@ -1507,7 +1507,8 @@ bool DoUpgrade(CommandLine &CmdL)
 bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, 
                    bool BrokenFix,
                    unsigned int& ExpectedInst, 
-                   const char *taskname)
+                   const char *taskname,
+                   bool Remove)
 {
    const char *start, *end;
    pkgCache::PkgIterator Pkg;
@@ -1536,7 +1537,7 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix,
       buf[end-start] = 0x0;
       if (regexec(&Pattern,buf,0,0,0) != 0)
         continue;
-      res &= TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst);
+      res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst);
       found = true;
    }
    
@@ -1604,7 +1605,7 @@ bool DoInstall(CommandLine &CmdL)
             // tasks must always be confirmed
             ExpectedInst += 1000;
             // see if we can install it
-            TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S);
+            TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S, Remove);
             continue;
          }
 
index f618b84..131cdbe 100644 (file)
@@ -4,6 +4,8 @@ apt (0.7.4) UNRELEASED; urgency=low
   * cmdline/apt-get.cc:
     - fix in the task-install code regexp (thanks to Adam Conrad and
       Colin Watson)
+    - support task removal too: apt-get remove taskname^
+      (thanks to Matt Zimmerman reporting this problem)
 
   [Otavio Salvador]
   * Fix a typo on 0.7.3 changelog entry about g++ (7.3 to 4.3)