]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
add cacheset push_back wrapping for std::back_inserter
[apt.git] / cmdline / apt-get.cc
index acf6c21555749a73030ae9e8a32505199e91c698..cef7d8c1477c08d57514e88a28fafcfe66d88484 100644 (file)
@@ -78,7 +78,6 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 #include <unistd.h>
 #include <pwd.h>
 #include <grp.h>
@@ -629,9 +628,6 @@ static bool DoDownload(CommandLine &CmdL)
       return true;
    }
 
-   // Disable drop-privs if "_apt" can not write to the target dir
-   CheckDropPrivsMustBeDisabled(Fetcher);
-
    if (_error->PendingError() == true || CheckAuth(Fetcher, false) == false)
       return false;
 
@@ -741,17 +737,22 @@ static bool DoSource(CommandLine &CmdL)
         }
         pos += vcs.length()+2;
         string::size_type epos = srec.find("\n", pos);
-        string uri = srec.substr(pos,epos-pos).c_str();
+        string const uri = srec.substr(pos,epos-pos);
         ioprintf(c1out, _("NOTICE: '%s' packaging is maintained in "
                           "the '%s' version control system at:\n"
                           "%s\n"),
                  Src.c_str(), vcs.c_str(), uri.c_str());
-        if(vcs == "Bzr") 
-           ioprintf(c1out,_("Please use:\n"
-                            "bzr branch %s\n"
-                            "to retrieve the latest (possibly unreleased) "
-                            "updates to the package.\n"),
-                    uri.c_str());
+        std::string vcscmd;
+        if (vcs == "Bzr")
+           vcscmd = "bzr branch " + uri;
+        else if (vcs == "Git")
+           vcscmd = "git clone " + uri;
+
+        if (vcscmd.empty() == false)
+           ioprintf(c1out,_("Please use:\n%s\n"
+                    "to retrieve the latest (possibly unreleased) "
+                    "updates to the package.\n"),
+                 vcscmd.c_str());
         break;
       }
 
@@ -850,9 +851,6 @@ static bool DoSource(CommandLine &CmdL)
       return true;
    }
 
-   // Disable drop-privs if "_apt" can not write to the target dir
-   CheckDropPrivsMustBeDisabled(Fetcher);
-
    // check authentication status of the source as well
    if (UntrustedList.empty() == false && AuthPrompt(UntrustedList, false) == false)
       return false;
@@ -942,19 +940,7 @@ static bool DoSource(CommandLine &CmdL)
       _exit(0);
    }
 
-   // Wait for the subprocess
-   int Status = 0;
-   while (waitpid(Process,&Status,0) != Process)
-   {
-      if (errno == EINTR)
-        continue;
-      return _error->Errno("waitpid","Couldn't wait for subprocess");
-   }
-
-   if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
-      return _error->Error(_("Child process failed"));
-   
-   return true;
+   return ExecWait(Process, "dpkg-source");
 }
                                                                        /*}}}*/
 // DoBuildDep - Install/removes packages to satisfy build dependencies  /*{{{*/
@@ -1403,11 +1389,6 @@ static bool DoChangelog(CommandLine &CmdL)
 
    if (printOnly == false)
    {
-      // Disable drop-privs if "_apt" can not write to the target dir
-      CheckDropPrivsMustBeDisabled(Fetcher);
-      if (_error->PendingError() == true)
-        return false;
-
       bool Failed = false;
       if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == true)
         return false;
@@ -1498,11 +1479,21 @@ static bool DoIndexTargets(CommandLine &CmdL)
               << "Description: " << T->Description << "\n"
               << "URI: " << T->URI << "\n"
               << "Filename: " << filename << "\n"
-              << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n";
+              << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n"
+              << "KeepCompressed: " << (T->KeepCompressed ? "yes" : "no") << "\n";
            for (std::map<std::string,std::string>::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O)
               stanza << format_key(O->first) << ": " << O->second << "\n";
            for (std::map<std::string,std::string>::const_iterator O = T->Options.begin(); O != T->Options.end(); ++O)
-              stanza << format_key(O->first) << ": " << O->second << "\n";
+           {
+              if (O->first == "PDIFFS")
+                 stanza << "PDiffs: " << O->second << "\n";
+              else if (O->first == "COMPRESSIONTYPES")
+                 stanza << "CompressionTypes: " << O->second << "\n";
+              else if (O->first == "DEFAULTENABLED")
+                 stanza << "DefaultEnabled: " << O->second << "\n";
+              else
+                 stanza << format_key(O->first) << ": " << O->second << "\n";
+           }
            stanza << "\n";
 
            if (Filtered)
@@ -1649,6 +1640,7 @@ int main(int argc,const char *argv[])                                     /*{{{*/
                                   {"markauto",&DoMarkAuto},
                                   {"unmarkauto",&DoMarkAuto},
                                    {"dist-upgrade",&DoDistUpgrade},
+                                   {"full-upgrade",&DoDistUpgrade},
                                    {"dselect-upgrade",&DoDSelectUpgrade},
                                   {"build-dep",&DoBuildDep},
                                    {"clean",&DoClean},