]> git.saurik.com Git - apt.git/commitdiff
merged from http://bzr.debian.org/bzr/apt/apt/debian-sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 15 Jul 2011 07:53:38 +0000 (09:53 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 15 Jul 2011 07:53:38 +0000 (09:53 +0200)
20 files changed:
apt-pkg/acquire-item.cc
apt-pkg/algorithms.cc
apt-pkg/algorithms.h
apt-pkg/aptconfiguration.h
apt-pkg/contrib/configuration.cc
apt-pkg/contrib/configuration.h
apt-pkg/depcache.cc
apt-pkg/indexcopy.cc
apt-pkg/init.cc
apt-pkg/pkgcachegen.cc
cmdline/apt-get.cc
debian/changelog
debian/rules
doc/apt.conf.5.xml
doc/examples/configure-index
methods/gpgv.cc
test/integration/framework
test/integration/test-resolve-by-keep-new-recommends [new file with mode: 0755]
test/integration/test-ubuntu-bug-784473-InRelease-one-message-only [new file with mode: 0755]
test/integration/test-ubuntu-bug-806274-install-suggests [new file with mode: 0755]

index a6698b367d10644795fb283fb877da435b134e67..aa77824f815b186b441d04cebdcf1b435592978d 100644 (file)
@@ -1473,8 +1473,10 @@ bool pkgAcqMetaIndex::VerifyVendor(string Message)                       /*{{{*/
         // TRANSLATOR: The first %s is the URL of the bad Release file, the second is
         // the time since then the file is invalid - formated in the same way as in
         // the download progress display (e.g. 7d 3h 42min 1s)
-        return _error->Error(_("Release file expired, ignoring %s (invalid since %s)"),
-                             RealURI.c_str(), TimeToStr(invalid_since).c_str());
+        return _error->Error(
+            _("Release file for %s is expired (invalid since %s). "
+              "Updates for this repository will not be applied."),
+            RealURI.c_str(), TimeToStr(invalid_since).c_str());
    }
 
    if (_config->FindB("Debug::pkgAcquire::Auth", false)) 
index 47bdd4abafaa827138d4d6db1f6f9a679b70bde7..8737c5334a50eb3049f28e829eab2afb7f49549c 100644 (file)
@@ -1204,6 +1204,31 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
    return true;
 }
                                                                        /*}}}*/
+
+// ProblemResolver::BreaksInstOrPolicy - Check if the given pkg is broken/*{{{*/
+// ---------------------------------------------------------------------
+/* This checks if the given package is broken either by a hard dependency
+   (InstBroken()) or by introducing a new policy breakage e.g. new
+   unsatisfied recommends for a package that was in "policy-good" state
+
+   Note that this is not perfect as it will ignore further breakage
+   for already broken policy (recommends)
+*/
+bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
+{
+   
+   // a broken install is always a problem
+   if (Cache[I].InstBroken() == true)
+      return true;
+
+   // a newly broken policy (recommends/suggests) is a problem
+   if (Cache[I].NowPolicyBroken() == false &&
+       Cache[I].InstPolicyBroken() == true)
+      return true;
+       
+   return false;
+}
+
 // ProblemResolver::ResolveByKeep - Resolve problems using keep                /*{{{*/
 // ---------------------------------------------------------------------
 /* This is the work horse of the soft upgrade routine. It is very gental 
@@ -1263,9 +1288,12 @@ bool pkgProblemResolver::ResolveByKeepInternal()
    {
       pkgCache::PkgIterator I(Cache,*K);
 
-      if (Cache[I].InstallVer == 0 || Cache[I].InstBroken() == false)
+      if (Cache[I].InstallVer == 0)
         continue;
 
+      if (InstOrNewPolicyBroken(I) == false)
+         continue;
+
       /* Keep the package. If this works then great, otherwise we have
                 to be significantly more agressive and manipulate its dependencies */
       if ((Flags[I->ID] & Protected) == 0)
@@ -1273,7 +1301,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
         if (Debug == true)
            clog << "Keeping package " << I.FullName(false) << endl;
         Cache.MarkKeep(I, false, false);
-        if (Cache[I].InstBroken() == false)
+        if (InstOrNewPolicyBroken(I) == false)
         {
            K = PList - 1;
            continue;
@@ -1323,11 +1351,11 @@ bool pkgProblemResolver::ResolveByKeepInternal()
                  Cache.MarkKeep(Pkg, false, false);
               }
               
-              if (Cache[I].InstBroken() == false)
+              if (InstOrNewPolicyBroken(I) == false)
                  break;
            }
            
-           if (Cache[I].InstBroken() == false)
+           if (InstOrNewPolicyBroken(I) == false)
               break;
 
            if (Start == End)
@@ -1335,11 +1363,11 @@ bool pkgProblemResolver::ResolveByKeepInternal()
            Start++;
         }
              
-        if (Cache[I].InstBroken() == false)
+        if (InstOrNewPolicyBroken(I) == false)
            break;
       }
 
-      if (Cache[I].InstBroken() == true)
+      if (InstOrNewPolicyBroken(I) == true)
         continue;
       
       // Restart again.
index 050934badcae91779107a61de54ae2c05cda20e9..86d5fbd5309d28439680524258fb0167b52aaf56 100644 (file)
@@ -112,6 +112,9 @@ class pkgProblemResolver                                            /*{{{*/
    bool ResolveInternal(bool const BrokenFix = false);
    bool ResolveByKeepInternal();
    
+   protected:
+   bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
+
    public:
    
    inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);};
index 815db6caee0fb4929cc5a9f7f1bedef8ff7ab465..1f0399dd292ca75ffbe9b389bbde6ab6593ae5e5 100644 (file)
@@ -36,7 +36,7 @@ public:                                                                       /*{{{*/
         *  \param Cached saves the result so we need to calculated it only once
         *                this parameter should ony be used for testing purposes.
         *
-        *  \return a vector of (all) Language Codes in the prefered usage order
+        *  \return a vector of the compression types in the prefered usage order
         */
        std::vector<std::string> static const getCompressionTypes(bool const &Cached = true);
 
index cc7093fe2cf4146c1574dcd38f03fead67ed2dc6..0664e370431f60d9d529f87ac84413b816435d52 100644 (file)
@@ -318,6 +318,19 @@ void Configuration::CndSet(const char *Name,const string &Value)
       Itm->Value = Value;
 }
                                                                        /*}}}*/
+// Configuration::Set - Set an integer value                           /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void Configuration::CndSet(const char *Name,int const Value)
+{
+   Item *Itm = Lookup(Name,true);
+   if (Itm == 0 || Itm->Value.empty() == false)
+      return;
+   char S[300];
+   snprintf(S,sizeof(S),"%i",Value);
+   Itm->Value = S;
+}
+                                                                       /*}}}*/
 // Configuration::Set - Set a value                                    /*{{{*/
 // ---------------------------------------------------------------------
 /* */
@@ -332,7 +345,7 @@ void Configuration::Set(const char *Name,const string &Value)
 // Configuration::Set - Set an integer value                           /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-void Configuration::Set(const char *Name,int const &Value)
+void Configuration::Set(const char *Name,int const Value)
 {
    Item *Itm = Lookup(Name,true);
    if (Itm == 0)
index 71e5a0e47b3f61dc40eb006661e945265bb8d863..3568ce8152ba8cded8d061a7111e6313ff2a9503 100644 (file)
@@ -82,8 +82,9 @@ class Configuration
              
    inline void Set(const string &Name,const string &Value) {Set(Name.c_str(),Value);};
    void CndSet(const char *Name,const string &Value);
+   void CndSet(const char *Name,const int Value);
    void Set(const char *Name,const string &Value);
-   void Set(const char *Name,const int &Value);
+   void Set(const char *Name,const int Value);
    
    inline bool Exists(const string &Name) const {return Exists(Name.c_str());};
    bool Exists(const char *Name) const;
index 1d905df2e202511d8720ff6ef828261b76bc6751..72a0bb542a404467ff48f601254eba94eed837ed 100644 (file)
@@ -1552,7 +1552,7 @@ bool pkgDepCache::MarkFollowsRecommends()
 
 bool pkgDepCache::MarkFollowsSuggests()
 {
-  return _config->FindB("APT::AutoRemove::SuggestsImportant", false);
+  return _config->FindB("APT::AutoRemove::SuggestsImportant", true);
 }
 
 // pkgDepCache::MarkRequired - the main mark algorithm                 /*{{{*/
index 064fb007c9decc7f9670b185d827a4886fc0ca5a..31c577705ebbb1ebe0e7dabf7efc856f5c527e6a 100644 (file)
@@ -664,6 +664,21 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,
 bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG,
                        int const &statusfd, int fd[2])
 {
+   if (File == FileGPG)
+   {
+      #define SIGMSG "-----BEGIN PGP SIGNED MESSAGE-----\n"
+      char buffer[sizeof(SIGMSG)];
+      FILE* gpg = fopen(File.c_str(), "r");
+      if (gpg == NULL)
+        return _error->Errno("RunGPGV", _("Could not open file %s"), File.c_str());
+      char const * const test = fgets(buffer, sizeof(buffer), gpg);
+      fclose(gpg);
+      if (test == NULL || strcmp(buffer, SIGMSG) != 0)
+        return _error->Error(_("File %s doesn't start with a clearsigned message"), File.c_str());
+      #undef SIGMSG
+   }
+
+
    string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv");
    // FIXME: remove support for deprecated APT::GPGV setting
    string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted"));
@@ -688,7 +703,11 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG,
    Args.reserve(30);
 
    if (keyrings.empty() == true)
-      return false;
+   {
+      // TRANSLATOR: %s is the trusted keyring parts directory
+      return _error->Error(_("No keyring installed in %s."),
+                          _config->FindDir("Dir::Etc::TrustedParts").c_str());
+   }
 
    Args.push_back(gpgvpath.c_str());
    Args.push_back("--ignore-time-conflict");
index 66b0119e605270df61466fe2e879b308eff47003..8f20c31df172b28e69ae89ec4139228453fe991f 100644 (file)
@@ -33,62 +33,65 @@ const char *pkgLibVersion = Stringfy(APT_PKG_MAJOR) "."
 bool pkgInitConfig(Configuration &Cnf)
 {
    // General APT things
-   Cnf.Set("APT::Architecture", COMMON_ARCH);
-   Cnf.Set("APT::Build-Essential::", "build-essential");
-   Cnf.Set("APT::Install-Recommends", true);
-   Cnf.Set("APT::Install-Suggests", false);
-   Cnf.Set("Dir","/");
+   Cnf.CndSet("APT::Architecture", COMMON_ARCH);
+   if (Cnf.Exists("APT::Build-Essential") == false)
+      Cnf.Set("APT::Build-Essential::", "build-essential");
+   Cnf.CndSet("APT::Install-Recommends", true);
+   Cnf.CndSet("APT::Install-Suggests", false);
+   Cnf.CndSet("Dir","/");
    
    // State   
-   Cnf.Set("Dir::State","var/lib/apt/");
+   Cnf.CndSet("Dir::State","var/lib/apt/");
    
    /* Just in case something goes horribly wrong, we can fall back to the
       old /var/state paths.. */
    struct stat St;   
    if (stat("/var/lib/apt/.",&St) != 0 &&
        stat("/var/state/apt/.",&St) == 0)
-      Cnf.Set("Dir::State","var/state/apt/");
+      Cnf.CndSet("Dir::State","var/state/apt/");
        
-   Cnf.Set("Dir::State::lists","lists/");
-   Cnf.Set("Dir::State::cdroms","cdroms.list");
-   Cnf.Set("Dir::State::mirrors","mirrors/");
+   Cnf.CndSet("Dir::State::lists","lists/");
+   Cnf.CndSet("Dir::State::cdroms","cdroms.list");
+   Cnf.CndSet("Dir::State::mirrors","mirrors/");
 
    // Cache
-   Cnf.Set("Dir::Cache","var/cache/apt/");
-   Cnf.Set("Dir::Cache::archives","archives/");
-   Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
-   Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin");
+   Cnf.CndSet("Dir::Cache","var/cache/apt/");
+   Cnf.CndSet("Dir::Cache::archives","archives/");
+   Cnf.CndSet("Dir::Cache::srcpkgcache","srcpkgcache.bin");
+   Cnf.CndSet("Dir::Cache::pkgcache","pkgcache.bin");
    
    // Configuration
-   Cnf.Set("Dir::Etc","etc/apt/");
-   Cnf.Set("Dir::Etc::sourcelist","sources.list");
-   Cnf.Set("Dir::Etc::sourceparts","sources.list.d");
-   Cnf.Set("Dir::Etc::vendorlist","vendors.list");
-   Cnf.Set("Dir::Etc::vendorparts","vendors.list.d");
-   Cnf.Set("Dir::Etc::main","apt.conf");
-   Cnf.Set("Dir::Etc::netrc", "auth.conf");
-   Cnf.Set("Dir::Etc::parts","apt.conf.d");
-   Cnf.Set("Dir::Etc::preferences","preferences");
-   Cnf.Set("Dir::Etc::preferencesparts","preferences.d");
-   Cnf.Set("Dir::Etc::trusted", "trusted.gpg");
-   Cnf.Set("Dir::Etc::trustedparts","trusted.gpg.d");
-
-   Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
-   Cnf.Set("Dir::Bin::solvers::","/usr/lib/apt/solvers");
-   Cnf.Set("Dir::Media::MountPath","/media/apt");
+   Cnf.CndSet("Dir::Etc","etc/apt/");
+   Cnf.CndSet("Dir::Etc::sourcelist","sources.list");
+   Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d");
+   Cnf.CndSet("Dir::Etc::vendorlist","vendors.list");
+   Cnf.CndSet("Dir::Etc::vendorparts","vendors.list.d");
+   Cnf.CndSet("Dir::Etc::main","apt.conf");
+   Cnf.CndSet("Dir::Etc::netrc", "auth.conf");
+   Cnf.CndSet("Dir::Etc::parts","apt.conf.d");
+   Cnf.CndSet("Dir::Etc::preferences","preferences");
+   Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d");
+   Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg");
+   Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d");
+   Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt/methods");
+   Cnf.CndSet("Dir::Bin::solvers::","/usr/lib/apt/solvers");
+   Cnf.CndSet("Dir::Media::MountPath","/media/apt");
 
    // State   
-   Cnf.Set("Dir::Log","var/log/apt");
-   Cnf.Set("Dir::Log::Terminal","term.log");
-   Cnf.Set("Dir::Log::History","history.log");
+   Cnf.CndSet("Dir::Log","var/log/apt");
+   Cnf.CndSet("Dir::Log::Terminal","term.log");
+   Cnf.CndSet("Dir::Log::History","history.log");
 
-   Cnf.Set("Dir::Ignore-Files-Silently::", "~$");
-   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$");
-   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
-   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
+   if (Cnf.Exists("Dir::Ignore-Files-Silently") == false)
+   {
+      Cnf.Set("Dir::Ignore-Files-Silently::", "~$");
+      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$");
+      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
+      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
+   }
 
    // Default cdrom mount point
-   Cnf.Set("Acquire::cdrom::mount", "/media/cdrom/");
+   Cnf.CndSet("Acquire::cdrom::mount", "/media/cdrom/");
 
    bool Res = true;
    
index 8e088ba68d1baaa037528bcb333e267d4722d824..b89c8c0d392588d86d92b841c1aece8a52713cfc 100644 (file)
@@ -1169,16 +1169,32 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
    SPtr<DynamicMMap> Map;
    if (Writeable == true && CacheFile.empty() == false)
    {
+      _error->PushToStack();
       unlink(CacheFile.c_str());
       CacheF = new FileFd(CacheFile,FileFd::WriteAtomic);
       fchmod(CacheF->Fd(),0644);
       Map = CreateDynamicMMap(CacheF, MMap::Public);
       if (_error->PendingError() == true)
-        return false;
-      if (Debug == true)
+      {
+        delete CacheF.UnGuard();
+        delete Map.UnGuard();
+        if (Debug == true)
+           std::clog << "Open filebased MMap FAILED" << std::endl;
+        Writeable = false;
+        if (AllowMem == false)
+        {
+           _error->MergeWithStack();
+           return false;
+        }
+        _error->RevertToStack();
+      }
+      else if (Debug == true)
+      {
+        _error->MergeWithStack();
         std::clog << "Open filebased MMap" << std::endl;
+      }
    }
-   else
+   if (Writeable == false || CacheFile.empty() == true)
    {
       // Just build it in memory..
       Map = CreateDynamicMMap(NULL);
index 94e078cb3a912baf02547606d6e05e2a91363adb..1a03acaa8c18b68671d5ad3a72f69f59f4bcbf9e 100644 (file)
@@ -1702,7 +1702,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 
    // we could have removed a new dependency of a garbage package,
    // so check if a reverse depends is broken and if so install it again.
-   if (tooMuch.empty() == false && Cache->BrokenCount() != 0)
+   if (tooMuch.empty() == false && (Cache->BrokenCount() != 0 || Cache->PolicyBrokenCount() != 0))
    {
       bool Changed;
       do {
@@ -1713,8 +1713,8 @@ bool DoAutomaticRemove(CacheFile &Cache)
            for (pkgCache::DepIterator R = P.RevDependsList();
                 R.end() == false; ++R)
            {
-              if (R->Type != pkgCache::Dep::Depends &&
-                  R->Type != pkgCache::Dep::PreDepends)
+              if (R.IsNegative() == true ||
+                  Cache->IsImportantDep(R) == false)
                  continue;
               pkgCache::PkgIterator N = R.ParentPkg();
               if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false))
index d226d91c4a68f877a01d24e8e98abde28686cd46..4d7f06fea469e1c53d70d47f304577c53cb020b5 100644 (file)
@@ -62,7 +62,14 @@ apt (0.8.16~exp1) experimental; urgency=low
 
  -- Michael Vogt <mvo@debian.org>  Wed, 29 Jun 2011 12:40:31 +0200
 
-apt (0.8.15.2) unstable; urgency=low
+apt (0.8.15.3) UNRELEASED; urgency=low
+
+  [ Michael Vogt ]
+  * apt-pkg/acquire-item.cc:
+    - improve error message for a expired Release file
+  * apt-pkg/algorithms.cc:
+    - Hold back packages that would enter "policy-broken" state on upgrade
+      when doing a "apt-get upgrade"
 
   [ David Kalnischkies ]
   * apt-pkg/pkgcachegen.cc:
@@ -70,8 +77,23 @@ apt (0.8.15.2) unstable; urgency=low
       told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591)
   * doc/sources.list.5.xml:
     - document available [options] for sources.list entries (Closes: 632441)
+  * doc/apt.conf.5.xml:
+    - document APT::Architectures list (Closes: #612102)
+  * cmdline/apt-get.cc:
+    - restore all important dependencies for garbage packages (LP: #806274)
+  * apt-pkg/init.cc:
+    - use CndSet in pkgInitConfig (Closes: #629617)
+  * apt-pkg/depcache.cc:
+    - change default of APT::AutoRemove::SuggestsImportant to true
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 15 Jul 2011 09:29:37 +0200
+
+apt (0.8.15.2) unstable; urgency=high
+
+  * fix from David Kalnischkies for the InRelease gpg verification 
+    code (LP: #784473)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Tue, 05 Jul 2011 15:12:21 +0200
+ -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200
 
 apt (0.8.15.1) unstable; urgency=low
 
index ef30568d5c9a680bbd255c8552a18ac4c21be260..1446a039ee514f60c99f28f03dfcf95a1e6d6cfc 100755 (executable)
@@ -124,9 +124,6 @@ libapt-pkg-doc: build-doc
 #
 # libapt-pkg-doc install
 #
-       # remove doxygen's embedded jquery as we don't use it anyway (#622147)
-       rm -f $(BLD)/doc/doxygen/html/jquery.js
-
        dh_installdocs -p$@ $(BLD)/docs/design* \
                            $(BLD)/docs/dpkg-tech* \
                            $(BLD)/docs/files* \
index 02de89f3ba80e2d9273680b16fcb6613d5391f6e..2634c47a948ecaf24b8bcd4c8c99793d7b888109 100644 (file)
@@ -153,7 +153,15 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
      parsing package lists. The internal default is the architecture apt was 
      compiled for.</para></listitem>
      </varlistentry>
-     
+
+     <varlistentry><term>Architectures</term>
+     <listitem><para>All Architectures the system supports. Processors implementing the <literal>amd64</literal>
+     are e.g. also able to execute binaries compiled for <literal>i386</literal>; This list is use when fetching files and
+     parsing package lists. The internal default is always the native architecture (<literal>APT::Architecture</literal>)
+     and all foreign architectures it can retrieve by calling <command>dpkg --print-foreign-architectures</command>.
+     </para></listitem>
+     </varlistentry>
+
      <varlistentry><term>Default-Release</term>
      <listitem><para>Default release to install packages from if more than one
      version available. Contains release name, codename or release version. Examples: 'stable', 'testing',
index 6884e06e32d82f3c6703aff7162f6957c787d092..27232d40b152987e86c9ed285bfbb79d16308007 100644 (file)
@@ -23,6 +23,7 @@ quiet::NoUpdate "true"; // never update progress information - included in -q=1
 APT 
 {
   Architecture "i386";
+  Architectures { "amd64"; "armel"; };
   Build-Essential "build-essential";
 
   NeverAutoRemove  { "linux-image.*";  };  // packages that should never
index efe1f73f7415d998b0fd3a4f167bd6db440cd876..960c06180eede581bdb1ebb0ef687189929ba4b3 100644 (file)
@@ -65,13 +65,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
       return string("Couldn't spawn new process") + strerror(errno);
    else if (pid == 0)
    {
-      if (SigVerify::RunGPGV(outfile, file, 3, fd) == false)
+      _error->PushToStack();
+      bool const success = SigVerify::RunGPGV(outfile, file, 3, fd);
+      if (success == false)
       {
-        // TRANSLATOR: %s is the trusted keyring parts directory
-        ioprintf(ret, _("No keyring installed in %s."),
-                 _config->FindDir("Dir::Etc::TrustedParts").c_str());
-        return ret.str();
+        string errmsg;
+        _error->PopMessage(errmsg);
+        _error->RevertToStack();
+        return errmsg;
       }
+      _error->RevertToStack();
       exit(111);
    }
    close(fd[1]);
index cc5af798c9b38448bba008ec9f85ac47ee1a1b84..96cdb5f5e31b9f01368646b5cdb0fdf5a17bcc7a 100644 (file)
@@ -708,3 +708,9 @@ testmarkedauto() {
        fi
        aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
 }
+
+pause() {
+       echo "STOPPED execution. Press enter to continue"
+       local IGNORE
+       read IGNORE
+}
diff --git a/test/integration/test-resolve-by-keep-new-recommends b/test/integration/test-resolve-by-keep-new-recommends
new file mode 100755 (executable)
index 0000000..8134b76
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertinstalledpackage 'foo' 'i386' '1.0'
+insertpackage 'unstable' 'foo' 'i386' '2.0' 'Recommends: bar'
+
+setupaptarchive
+
+UPGRADE_KEEP="Reading package lists...
+Building dependency tree...
+The following packages have been kept back:
+  foo
+0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded."
+testequal "$UPGRADE_KEEP" aptget upgrade -s
+
diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only
new file mode 100755 (executable)
index 0000000..d970119
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'unstable' 'apt' 'i386' '0.8.11'
+
+setupaptarchive
+
+rm -rf rootdir/var/lib/apt/lists
+
+find aptarchive/ -name 'Release.gpg' -delete
+find aptarchive/ -name 'InRelease' -exec cp {} {}.old \;
+
+for RELEASE in $(find aptarchive/ -name 'InRelease'); do
+       (echo 'Origin: Marvin
+Label: Marvin
+Suite: experimental
+Codename: experimental
+MD5Sum:
+ 65fd410587b6978de2277f2912523f09     9360 Packages
+ d27b294ed172a1fa9dd5a53949914c5d     4076 Packages.bz2
+ 2182897e0a2a0c09e760beaae117a015     2023 Packages.diff/Index
+ 1b895931853981ad8204d2439821b999     4144 Packages.gz'; echo; cat ${RELEASE}.old;) > ${RELEASE}
+done
+aptget update -qq > /dev/null 2> starts-with-unsigned.msg
+sed -i 's#File .*InRelease#File InRelease#' starts-with-unsigned.msg
+testfileequal starts-with-unsigned.msg "W: GPG error: file: unstable InRelease: File InRelease doesn't start with a clearsigned message"
diff --git a/test/integration/test-ubuntu-bug-806274-install-suggests b/test/integration/test-ubuntu-bug-806274-install-suggests
new file mode 100755 (executable)
index 0000000..fb72f09
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'apt' 'i386' '0.8.15' 'Depends: foo
+Recommends: bar
+Suggests: baz'
+insertpackage 'unstable' 'foo' 'i386' '1.0'
+insertpackage 'unstable' 'bar' 'i386' '1.0'
+insertpackage 'unstable' 'baz' 'i386' '1.0'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  bar foo
+Suggested packages:
+  baz
+The following NEW packages will be installed:
+  apt bar foo
+0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [i386])
+Conf foo (1.0 unstable [i386])
+Inst apt (0.8.15 unstable [i386])
+Conf apt (0.8.15 unstable [i386])
+Inst bar (1.0 unstable [i386])
+Conf bar (1.0 unstable [i386])' aptget install apt -s --install-recommends --no-install-suggests
+
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  bar baz foo
+The following NEW packages will be installed:
+  apt bar baz foo
+0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [i386])
+Conf foo (1.0 unstable [i386])
+Inst apt (0.8.15 unstable [i386])
+Conf apt (0.8.15 unstable [i386])
+Inst bar (1.0 unstable [i386])
+Inst baz (1.0 unstable [i386])
+Conf bar (1.0 unstable [i386])
+Conf baz (1.0 unstable [i386])' aptget install apt -s --install-recommends --install-suggests
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  foo
+Suggested packages:
+  baz
+Recommended packages:
+  bar
+The following NEW packages will be installed:
+  apt foo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [i386])
+Conf foo (1.0 unstable [i386])
+Inst apt (0.8.15 unstable [i386])
+Conf apt (0.8.15 unstable [i386])' aptget install apt -s --no-install-recommends --no-install-suggests
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  baz foo
+Recommended packages:
+  bar
+The following NEW packages will be installed:
+  apt baz foo
+0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [i386])
+Conf foo (1.0 unstable [i386])
+Inst apt (0.8.15 unstable [i386])
+Conf apt (0.8.15 unstable [i386])
+Inst baz (1.0 unstable [i386])
+Conf baz (1.0 unstable [i386])' aptget install apt -s --no-install-recommends --install-suggests