]> git.saurik.com Git - apt.git/commitdiff
merge with debian-sid 0.8.15.2
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 14 Jul 2011 19:28:50 +0000 (21:28 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 14 Jul 2011 19:28:50 +0000 (21:28 +0200)
14 files changed:
apt-pkg/contrib/configuration.cc
apt-pkg/contrib/configuration.h
apt-pkg/init.cc
apt-pkg/pkgcachegen.cc
cmdline/apt-get.cc
debian/apt.symbols
debian/changelog
debian/rules
doc/apt.conf.5.xml
doc/examples/configure-index
doc/sources.list.5.xml
test/integration/framework
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 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 31b2d9ccd163f7606797da2bf8669049fa440ed8..38a0814e54ed52f0879c50ae79748b2f2610c546 100644 (file)
@@ -33,60 +33,64 @@ 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::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::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 9820fde81996c413494970f74f4eb57834b8cba9..8f9737e265e9de696b225cd7f6867e47e177d775 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 845c92026b66602e3f9799e0b634451d23f823f8..3292ae745ac4255688583ed2aec99ec5c3b4f146 100644 (file)
@@ -1697,7 +1697,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 {
@@ -1708,8 +1708,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 04e13edd764b70e9efc8c3a3c40a55bcab033584..932fb14114b4c3c16580abc85945ac084a1c5ee5 100644 (file)
@@ -1256,7 +1256,6 @@ libapt-pkg.so.4.10 libapt-pkg4.10
  (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1
  (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1
  (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1
-
  (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1
  (arch=armel armhf|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 1
  (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1
index 9a069215c04e109d48bd3267ad3e70d4ceb05312..52972e43b352a2e3319cb3d07497f3b4fa63f576 100644 (file)
@@ -1,12 +1,26 @@
 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"
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 14 Jul 2011 11:22:54 +0200
+  [ David Kalnischkies ]
+  * apt-pkg/pkgcachegen.cc:
+    - fallback to memory if file is not writeable even if access()
+      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)
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 14 Jul 2011 21:26:09 +0200
 
 apt (0.8.15.2) unstable; urgency=high
 
index 0544b2b8e1c92cdea83e2715c28c7ed2c61a929d..6409006788aa17e2b12e0138b9b8ff0fbba81f62 100755 (executable)
@@ -120,9 +120,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 837f07683b056ba2f18d4aa50cbd0e45f3f17e61..fab125b4e701971962a243591aa021f3b45f2370 100644 (file)
@@ -78,7 +78,7 @@
    <para>The format for a <filename>sources.list</filename> entry using the
    <literal>deb</literal> and <literal>deb-src</literal> types is:</para>
 
-   <literallayout>deb uri distribution [component1] [component2] [...]</literallayout>
+   <literallayout>deb [ options ] uri distribution [component1] [component2] [...]</literallayout>
 
    <para>The URI for the <literal>deb</literal> type must specify the base of the
    Debian distribution, from which APT will find the information it needs. 
    simultaneous anonymous users. APT also parallelizes connections to 
    different hosts to more effectively deal with sites with low bandwidth.</para>
 
+   <para><literal>options</literal> is always optional and needs to be surounded by
+   square brackets. It can consist of multiple settings in the form
+   <literal><replaceable>setting</replaceable>=<replaceable>value</replaceable></literal>.
+   Multiple settings are separated by spaces. The following settings are supported by APT,
+   note through that unsupported settings will be ignored silently:
+   <itemizedlist><listitem><para><literal>arch=<replaceable>arch1</replaceable>,<replaceable>arch2</replaceable>,…</literal>
+   can be used to specify for which architectures packages information should
+   be downloaded. If this option is not set all architectures defined by the
+   <literal>APT::Architectures</literal> option will be downloaded.</para>
+   </listitem></itemizedlist></para>
+
    <para>It is important to list sources in order of preference, with the most
    preferred source listed first. Typically this will result in sorting
    by speed from fastest to slowest (CD-ROM followed by hosts on a local
@@ -206,6 +217,11 @@ deb http://security.debian.org/ &stable-codename;/updates main contrib non-free
    <para>Source line for the above</para>
    <literallayout>deb-src file:/home/jason/debian unstable main contrib non-free</literallayout>
 
+   <para>The first line gets package information for the architectures in <literal>APT::Architectures</literal>
+   while the second always retrieves <literal>amd64</literal> and <literal>armel</literal>.</para>
+   <literallayout>deb http://ftp.debian.org/debian &stable-codename; main
+deb [ arch=amd64,armel ] http://ftp.debian.org/debian &stable-codename; main</literallayout>
+
    <para>Uses HTTP to access the archive at archive.debian.org, and uses only
    the hamm/main area.</para>
    <literallayout>deb http://archive.debian.org/debian-archive hamm main</literallayout>
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-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