]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
add and use 'apt-key verify' which prefers gpgv over gpg
[apt.git] / cmdline / apt-get.cc
index bd866bc8c66ee3e510d456b7593558ded17ae2cb..aed1beb4df6c6009fb51b2f02d182cc5c86ccce5 100644 (file)
@@ -540,7 +540,7 @@ static bool DoDSelectUpgrade(CommandLine &)
    }
 
    // Now upgrade everything
-   if (pkgAllUpgrade(Cache) == false)
+   if (APT::Upgrade::Upgrade(Cache, APT::Upgrade::FORBID_REMOVE_PACKAGES | APT::Upgrade::FORBID_INSTALL_NEW_PACKAGES) == false)
    {
       ShowBroken(c1out,Cache,false);
       return _error->Error(_("Internal error, problem resolver broke stuff"));
@@ -955,18 +955,19 @@ static bool DoSource(CommandLine &CmdL)
         else
         {
            // Call dpkg-source
-           char S[500];
-           snprintf(S,sizeof(S),"%s -x %s",
+           std::string const sourceopts = _config->Find("DPkg::Source-Options", "-x");
+           std::string S;
+           strprintf(S, "%s %s %s",
                     _config->Find("Dir::Bin::dpkg-source","dpkg-source").c_str(),
-                    Dsc[I].Dsc.c_str());
-           if (system(S) != 0)
+                    sourceopts.c_str(), Dsc[I].Dsc.c_str());
+           if (system(S.c_str()) != 0)
            {
-              fprintf(stderr,_("Unpack command '%s' failed.\n"),S);
-              fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"));
+              fprintf(stderr, _("Unpack command '%s' failed.\n"), S.c_str());
+              fprintf(stderr, _("Check if the 'dpkg-dev' package is installed.\n"));
               _exit(1);
-           }       
+           }
         }
-        
+
         // Try to compile it with dpkg-buildpackage
         if (_config->FindB("APT::Get::Compile",false) == true)
         {
@@ -982,20 +983,20 @@ static bool DoSource(CommandLine &CmdL)
            buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
 
            // Call dpkg-buildpackage
-           char S[500];
-           snprintf(S,sizeof(S),"cd %s && %s %s",
+           std::string S;
+           strprintf(S, "cd %s && %s %s",
                     Dir.c_str(),
                     _config->Find("Dir::Bin::dpkg-buildpackage","dpkg-buildpackage").c_str(),
                     buildopts.c_str());
-           
-           if (system(S) != 0)
+
+           if (system(S.c_str()) != 0)
            {
-              fprintf(stderr,_("Build command '%s' failed.\n"),S);
+              fprintf(stderr, _("Build command '%s' failed.\n"), S.c_str());
               _exit(1);
-           }       
-        }      
+           }
+        }
       }
-      
+
       _exit(0);
    }
 
@@ -1065,9 +1066,12 @@ static bool DoBuildDep(CommandLine &CmdL)
       string Src;
       pkgSrcRecords::Parser *Last = 0;
 
-      // a unpacked debian source tree
-      if (DirectoryExists(*I))
+      // an unpacked debian source tree
+      using APT::String::Startswith;
+      if ((Startswith(*I, "./") || Startswith(*I, "/")) &&
+          DirectoryExists(*I))
       {
+         ioprintf(c1out, _("Note, using directory '%s' to get the build dependencies\n"), *I);
          // FIXME: how can we make this more elegant?
          std::string TypeName = "debian/control File Source Index";
          pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());
@@ -1077,6 +1081,8 @@ static bool DoBuildDep(CommandLine &CmdL)
       // if its a local file (e.g. .dsc) use this
       else if (FileExists(*I))
       {
+         ioprintf(c1out, _("Note, using file '%s' to get the build dependencies\n"), *I);
+
          // see if we can get a parser for this pkgIndexFile type
          string TypeName = flExtension(*I) + " File Source Index";
          pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());