]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Sync with Michael
[apt.git] / cmdline / apt-get.cc
index 74824b6b05e91e7f2cb10791db66a5f53d940de2..554677f39da64df196fe2f5bd4b4a167d3c88873 100644 (file)
@@ -1535,7 +1535,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,BrokenFix,ExpectedInst);
+      res &= TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst);
       found = true;
    }
    
@@ -1595,6 +1595,18 @@ bool DoInstall(CommandLine &CmdL)
         bool Remove = DefRemove;
         char *VerTag = 0;
         bool VerIsRel = false;
+
+         // this is a task!
+         if (Length >= 1 && S[Length - 1] == '^')
+         {
+            S[--Length] = 0;
+            // tasks must always be confirmed
+            ExpectedInst += 1000;
+            // see if we can install it
+            TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S);
+            continue;
+         }
+
         while (Cache->FindPkg(S).end() == true)
         {
            // Handle an optional end tag indicating what to do
@@ -1743,10 +1755,8 @@ bool DoInstall(CommandLine &CmdL)
         return _error->Error(_("Broken packages"));
       }   
    }
-   if (_config->FindB("APT::Get::AutomaticRemove")) {
-      if (!DoAutomaticRemove(Cache)) 
-        return false;
-   }
+   if (!DoAutomaticRemove(Cache)) 
+      return false;
 
    /* Print out a list of packages that are going to be installed extra
       to what the user asked */
@@ -2131,6 +2141,11 @@ bool DoSource(CommandLine &CmdL)
             I->Type != "tar")
            continue;
 
+        // Dsc only mode only fetches .dsc files
+        if (_config->FindB("APT::Get::Dsc-Only",false) == true &&
+            I->Type != "dsc")
+           continue;
+
         // don't download the same uri twice (should this be moved to
         // the fetcher interface itself?)
         if(queued.find(Last->Index().ArchiveURI(I->Path)) != queued.end())
@@ -2714,7 +2729,8 @@ int main(int argc,const char *argv[])
       {0,"force-yes","APT::Get::force-yes",0},
       {0,"print-uris","APT::Get::Print-URIs",0},
       {0,"diff-only","APT::Get::Diff-Only",0},
-      {0,"tar-only","APT::Get::tar-Only",0},
+      {0,"tar-only","APT::Get::Tar-Only",0},
+      {0,"dsc-only","APT::Get::Dsc-Only",0},
       {0,"purge","APT::Get::Purge",0},
       {0,"list-cleanup","APT::Get::List-Cleanup",0},
       {0,"reinstall","APT::Get::ReInstall",0},