]> git.saurik.com Git - apt.git/commitdiff
merged from the mvo branch
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 24 Aug 2009 11:30:05 +0000 (13:30 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 24 Aug 2009 11:30:05 +0000 (13:30 +0200)
14 files changed:
apt-pkg/contrib/mmap.cc
apt-pkg/pkgcache.cc
apt-pkg/sourcelist.cc
cmdline/apt-get.cc
configure.in
debian/NEWS [new file with mode: 0644]
debian/NEWS.Debian [deleted file]
debian/apt.cron.daily
debian/changelog
debian/control
doc/apt.conf.5.xml
methods/ftp.cc
methods/http.cc
methods/https.cc

index aa52b4c3066ef923ee5c622a98f77a21c0714622..4d5fcf71e67c5bdda2ddf504cf9c39c90d0d1ed9 100644 (file)
@@ -317,7 +317,7 @@ unsigned long DynamicMMap::WriteString(const char *String,
    but why we should not at least try to grow it before we give up? */
 bool DynamicMMap::Grow()
 {
-#ifdef _POSIX_MAPPED_FILES
+#if defined(_POSIX_MAPPED_FILES) && defined(__linux__)
    unsigned long newSize = WorkSpace + 1024*1024;
 
    if(Fd != 0)
index 2a9756c453becc538fd89f444498873cf1cced2a..b0ce6e5989728f351b5428beddfade624525d37c 100644 (file)
@@ -275,13 +275,13 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const
       return NeedsUnpack;
    
    if (Pkg->CurrentState == pkgCache::State::UnPacked ||
-       Pkg->CurrentState == pkgCache::State::HalfConfigured ||
-      //we don't need to care for triggers awaiting packages
-      //dpkg will deal with them automatically when the 
-      //trigger pending action is run (those packages are usually
-      //in half-configured or triggers-pending state)
+       Pkg->CurrentState == pkgCache::State::HalfConfigured)
+      // we leave triggers alone complettely. dpkg deals with
+      // them in a hard-to-predict manner and if they get 
+      // resolved by dpkg before apt run dpkg --configure on 
+      // the TriggersPending package dpkg returns a error
       //Pkg->CurrentState == pkgCache::State::TriggersAwaited
-       Pkg->CurrentState == pkgCache::State::TriggersPending)
+      //Pkg->CurrentState == pkgCache::State::TriggersPending)
       return NeedsConfigure;
    
    if (Pkg->CurrentState == pkgCache::State::HalfInstalled ||
index 47a08ad9071a2c5a99470c68400ecd2f8cc3aad8..4b3abe918482b557b217101fbf8802ad73541bbc 100644 (file)
@@ -157,15 +157,18 @@ bool pkgSourceList::ReadMainList()
    // CNC:2003-11-28 - Entries in sources.list have priority over
    //                  entries in sources.list.d.
    string Main = _config->FindFile("Dir::Etc::sourcelist");
+   string Parts = _config->FindDir("Dir::Etc::sourceparts");
+   
    if (FileExists(Main) == true)
       Res &= ReadAppend(Main);
-   else
+   else if (FileExists(Parts) == false)
+      // Only warn if there are no sources.list.d.
       _error->WarningE("FileExists",_("Unable to read %s"),Main.c_str());
 
-   string Parts = _config->FindDir("Dir::Etc::sourceparts");
    if (FileExists(Parts) == true)
       Res &= ReadSourceDir(Parts);
-   else
+   else if (FileExists(Main) == false)
+      // Only warn if there is no sources.list file.
       _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str());
 
    return Res;
index 7385c3dd39b02e755f8e370f33d264d6ae8fe526..49553157e3c306944e3509650ef2d74156993146 100644 (file)
@@ -1262,7 +1262,8 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
    /* Lookup the version of the package we would install if we were to
       install a version and determine the source package name, then look
       in the archive for a source package of the same name. */
-   if (_config->FindB("APT::Get::Only-Source") == false)
+   bool MatchSrcOnly = _config->FindB("APT::Get::Only-Source");
+   if (MatchSrcOnly == false)
    {
       if (Pkg.end() == false)
       {
@@ -1280,7 +1281,6 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
    unsigned long Offset = 0;
    string Version;
    bool IsMatch = false;
-   bool MatchSrcOnly = false;
 
    // No source package name..
    if (Src.empty() == true)
index f590310a480ed1f95014b006c579a78e89c13ac2..7287b925ae630156f17ad971bee68eeb422a7a68 100644 (file)
@@ -18,8 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-
-AC_DEFINE_UNQUOTED(VERSION,"0.7.21")
+AC_DEFINE_UNQUOTED(VERSION,"0.7.22.3")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644 (file)
index 0000000..19f0679
--- /dev/null
@@ -0,0 +1,27 @@
+apt (0.7.22.3) unstable; urgency=low
+
+  * Code that determines which proxy to use was changed. Now
+    'Acquire::{http,ftp}::Proxy[::<host>]' options have the highest priority,
+    and '{http,ftp}_proxy' environment variables are used only if options
+    mentioned above are not specified.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Thu, 19 Aug 2009 11:26:16 +0200
+
+apt (0.6.44) unstable; urgency=low
+
+  * apt-ftparchive --db now uses Berkeley DB_BTREE instead of DB_HASH. 
+    If you use a database created by an older version of apt, delete 
+    it and allow it to be recreated the next time.
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 26 Apr 2006 12:57:53 +0200
+
+apt (0.5.25) unstable; urgency=low
+
+  * apt-ftparchive --db now uses Berkeley DB version 4.2.  If used with a
+    database created by an older version of apt, an attempt will be made
+    to upgrade the database, but this may not work in all cases.  If your
+    database is not automatically upgraded, delete it and allow it to be
+    recreated the next time.
+
+ -- Matt Zimmerman <mdz@debian.org>  Sat,  8 May 2004 12:38:07 -0700
+
diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian
deleted file mode 100644 (file)
index f44d196..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-apt (0.6.44) unstable; urgency=low
-
-  * apt-ftparchive --db now uses Berkeley DB_BTREE instead of DB_HASH. 
-    If you use a database created by an older version of apt, delete 
-    it and allow it to be recreated the next time.
-
- -- Michael Vogt <mvo@debian.org>  Wed, 26 Apr 2006 12:57:53 +0200
-
-apt (0.5.25) unstable; urgency=low
-
-  * apt-ftparchive --db now uses Berkeley DB version 4.2.  If used with a
-    database created by an older version of apt, an attempt will be made
-    to upgrade the database, but this may not work in all cases.  If your
-    database is not automatically upgraded, delete it and allow it to be
-    recreated the next time.
-
- -- Matt Zimmerman <mdz@debian.org>  Sat,  8 May 2004 12:38:07 -0700
-
index 980bfbb9da6eed4cbef1788d1e893483d709f0ad..328282a41cae9c92e71feb1129fdbae0b5723982 100644 (file)
@@ -4,17 +4,58 @@
 #set -e
 #
 # This file understands the following apt configuration variables:
+# Values here are the default.
+# Create /etc/apt/apt.conf.d/02periodic file to set your preference.
 #
-#  "APT::Periodic::Update-Package-Lists=1"
+#  Dir "/";
+#  - RootDir for all configuration files
+#
+#  Dir::Cache "var/apt/cache/";
+#  - Set apt package cache directory
+#
+#  Dir::Cache::Archive "archives/";
+#  - Set package archive directory
+#
+#  APT::Periodic::Enable "1";
+#  - Enable the update/upgrade script (0=disable)
+#
+#  APT::Periodic::BackupArchiveInterval "0";
+#  - Backup after n-days if archive contents changed.(0=disable)
+#
+#  APT::Periodic::BackupLevel "3";
+#  - Backup level.(0=disable), 1 is invalid.
+#
+#  Dir::Cache::Backup "backup/";
+#  - Set periodic package backup directory
+#
+#  APT::Archives::MaxAge "0"; (old, deprecated)
+#  APT::Periodic::MaxAge "0"; (new)
+#  - Set maximum allowed age of a cache package file. If a cache 
+#    package file is older it is deleted (0=disable)
+#
+#  APT::Archives::MinAge "2"; (old, deprecated)
+#  APT::Periodic::MinAge "2"; (new)
+#  - Set minimum age of a package file. If a file is younger it
+#    will not be deleted (0=disable). Usefull to prevent races 
+#    and to keep backups of the packages for emergency.
+#
+#  APT::Archives::MaxSize "0"; (old, deprecated)
+#  APT::Periodic::MaxSize "0"; (new)
+#  - Set maximum size of the cache in MB (0=disable). If the cache
+#    is bigger, cached package files are deleted until the size
+#    requirement is met (the biggest packages will be deleted 
+#    first).
+#
+#  APT::Periodic::Update-Package-Lists "0";
 #  - Do "apt-get update" automatically every n-days (0=disable)
 #    
 #  "APT::Periodic::Download-Upgradeable-Packages=0",
 #  - Do "apt-get upgrade --download-only" every n-days (0=disable)
-# 
-#  "APT::Periodic::AutocleanInterval"
-#  - Do "apt-get autoclean" every n-days (0=disable)
 #
-#  "APT::Periodic::Unattended-Upgrade"
+#  APT::Periodic::Download-Upgradeable-Packages-Debdelta "1";
+#  - Use debdelta-upgrade to download updates if available (0=disable)
+#
+#  APT::Periodic::Unattended-Upgrade "0";
 #  - Run the "unattended-upgrade" security upgrade script 
 #    every n-days (0=disabled)
 #    Requires the package "unattended-upgrades" and will write
@@ -301,12 +342,18 @@ if ! which apt-config >/dev/null ; then
        exit 0
 fi
 
+# check if the user really wants to do something
+AutoAptEnable=1  # default is yes
+eval $(apt-config shell AutoAptEnable APT::Periodic::Enable)
+
+if [ $AutoAptEnable -eq 0 ]; then
+    exit 0
+fi
+
 # Set VERBOSE mode from  apt-config (or inherit from environment)
+VERBOSE=0
 eval $(apt-config shell VERBOSE APT::Periodic::Verbose)
 debug_echo "verbose level $VERBOSE"
-if [ -z "$VERBOSE" ]; then
-    VERBOSE="0"
-fi
 if [ "$VERBOSE" -le 2 ]; then
     # quiet for 0,1,2
     XSTDOUT=">/dev/null"
@@ -367,6 +414,9 @@ eval $(apt-config shell AutocleanInterval APT::Periodic::AutocleanInterval)
 BackupArchiveInterval=0
 eval $(apt-config shell BackupArchiveInterval APT::Periodic::BackupArchiveInterval)
 
+Debdelta=1
+eval $(apt-config shell Debdelta APT::Periodic::Download-Upgradeable-Packages-Debdelta)
+
 # check if we actually have to do anything
 if [ $UpdateInterval -eq 0 ] &&
    [ $DownloadUpgradeableInterval -eq 0 ] &&
@@ -432,6 +482,9 @@ fi
 # download all upgradeable packages (if it is requested)
 DOWNLOAD_UPGRADEABLE_STAMP=/var/lib/apt/periodic/download-upgradeable-stamp
 if [ $UPDATED -eq 1 ] && check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
+    if [ $Debdelta -eq 1 ]; then
+        debdelta-upgrade >/dev/null 2>&1 || true
+    fi
     if  eval apt-get $XAPTOPT -y -d dist-upgrade $XSTDERR; then
        update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
        debug_echo "download upgradable (success)"
index 01fc6e2c7427b6d4ec8976493d64e1fa8d6b07f1..dbd8fe5b3d4f2d5ab17a12c117e360f020786272 100644 (file)
@@ -1,11 +1,19 @@
-apt (0.7.23ubuntu1) karmic; urgency=low
+apt (0.7.22.3) UNRELEASED; urgency=low
 
+  [ Eugene V. Lyubimkin ]
+  * methods/{http,https,ftp}, doc/apt.conf.5.xml:
+    - Changed and unified the code that determines which proxy to use. Now
+      'Acquire::{http,ftp}::Proxy[::<host>]' options have the highest priority,
+      and '{http,ftp}_proxy' environment variables are used only if options
+      mentioned above are not specified.
+      (Closes: #445985, #157759, #320184, #365880, #479617)
+  
   [ Michael Vogt ]
-  * merged from the debian-sid bzr branch
-
-  * cmdline/apt-get.cc:
-    - honor APT::Get::Only-Source properly in FindSrc() (thanks to
-      Martin Pitt for reporting the problem)
+  * apt-pkg/pkgcache.cc:
+    - do not set internel "needs-configure" state for packages in 
+      triggers-pending state. dpkg will deal with the trigger and
+      it if does it before we trigger it, dpkg will error out
+      (LP: #414631)
 
   [ Matt Zimmerman ]
   * apt-pkg/deb/dpkgpm.cc:
@@ -16,7 +24,36 @@ apt (0.7.23ubuntu1) karmic; urgency=low
   * cmdline/apt-get.cc:
     - typo fix (LP: #370094)
 
- -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 06 Aug 2009 16:37:04 +0100
+ -- Michael Vogt <mvo@debian.org>  Wed, 19 Aug 2009 11:14:15 +0200
+
+apt (0.7.22.2) unstable; urgency=low
+
+  * debian/apt.cron.daily:
+    - Make sure that VERBOSE is always set (Closes: #539366)
+    - Script can be disabled by APT::Periodic::Enable=0 (Closes: #485476)
+    - Support using debdelta to download packages (Closes: #532079)
+
+ -- Julian Andres Klode <jak@debian.org>  Thu, 06 Aug 2009 12:17:19 +0200
+
+apt (0.7.22.1) unstable; urgency=low
+
+  [ Michael Vogt ]
+  * cmdline/apt-get.cc:
+    - honor APT::Get::Only-Source properly in FindSrc() (thanks to
+      Martin Pitt for reporting the problem), also Closes: #535362.
+
+  [ Julian Andres Klode ]
+  * apt-pkg/contrib/mmap.cc:
+    - Fix FTBFS on GNU/kFreeBSD by disabling DynamicMMap::Grow() on
+      non-Linux architectures as it uses mremap (Closes: #539742).
+  * apt-pkg/sourcelist.cc:
+    - Only warn about missing sources.list if there is no sources.list.d
+      and vice versa as only one of them is needed (Closes: #539731).
+  * debian/control:
+    - Add myself to Uploaders.
+    - Increase Standards-Version to 3.8.2.0.
+
+ -- Julian Andres Klode <jak@debian.org>  Mon, 03 Aug 2009 12:48:31 +0200
 
 apt (0.7.22) unstable; urgency=low
 
@@ -135,7 +172,7 @@ apt (0.7.22) unstable; urgency=low
   [ Osamu Aoki ]
   * Updated cron script to support backups by hardlinks and 
     verbose levels.  All features turned off by default. 
-  * Added more error handlings.  Closes: #438803, #462734, #454989
+  * Added more error handlings.  Closes: #438803, #462734, #454989
   * Documented all cron script related configuration items in 
     configure-index.
 
@@ -373,7 +410,7 @@ apt (0.7.20) unstable; urgency=low
   * buildlib/config.{sub,guess}:
     - Renewed. This fixes lintian errors.
   * doc/apt.conf.5.xml, debian/apt-transport-https:
-    - Documented briefly 'APT::https' group of options. (Closes: #507398)
+    - Documented briefly 'Acquire::https' group of options. (Closes: #507398)
     - Applied patch from Daniel Burrows to document 'Debug' group of options.
       (Closes: #457265)
     - Mentioned 'APT::Periodic' and 'APT::Archives' groups of options.
index 03cc52d87d66bb80acc02de20e9464683ad5fc8a..6587c2eb64e05c670ba6290f19636fc9e62946a2 100644 (file)
@@ -5,10 +5,9 @@ Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
 XSBC-Original-Maintainer: APT Development Team <deity@lists.debian.org>
 Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
  Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
- Luca Bruno <lethalman88@gmail.com>
-Standards-Version: 3.8.1.0
+ Luca Bruno <lethalman88@gmail.com>, Julian Andres Klode <jak@debian.org>
+Standards-Version: 3.8.2.0
 Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, docbook-utils (>= 0.6.12), xsltproc, docbook-xsl, xmlto, intltool
-Vcs-Bzr: http://code.launchpad.net/~ubuntu-core-dev/apt/ubuntu
 
 Package: apt
 Architecture: any
index 2b2430c8353b98bfa698f6290eb217190d6e5ae3..1fe980d285309e5464ad907b56ab4f055600fc57 100644 (file)
@@ -203,8 +203,9 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
      standard form of <literal>http://[[user][:pass]@]host[:port]/</literal>. Per 
      host proxies can also be specified by using the form 
      <literal>http::Proxy::&lt;host&gt;</literal> with the special keyword <literal>DIRECT</literal> 
-     meaning to use no proxies. The <envar>http_proxy</envar> environment variable
-     will override all settings.</para>
+        meaning to use no proxies. If no one of the above settings is specified,
+        <envar>http_proxy</envar> environment variable
+        will be used.</para>
 
      <para>Three settings are provided for cache control with HTTP/1.1 compliant 
      proxy caches. <literal>No-Cache</literal> tells the proxy to not use its cached 
@@ -252,9 +253,13 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
         </para></listitem></varlistentry>
 
      <varlistentry><term>ftp</term>
-     <listitem><para>FTP URIs; ftp::Proxy is the default proxy server to use. It is in the 
-     standard form of <literal>ftp://[[user][:pass]@]host[:port]/</literal> and is 
-     overridden by the <envar>ftp_proxy</envar> environment variable. To use a ftp 
+     <listitem><para>FTP URIs; ftp::Proxy is the default ftp proxy to use. It is in the 
+     standard form of <literal>ftp://[[user][:pass]@]host[:port]/</literal>. Per 
+     host proxies can also be specified by using the form 
+     <literal>ftp::Proxy::&lt;host&gt;</literal> with the special keyword <literal>DIRECT</literal> 
+        meaning to use no proxies. If no one of the above settings is specified,
+        <envar>ftp_proxy</envar> environment variable
+        will be used. To use a ftp 
      proxy you will have to set the <literal>ftp::ProxyLogin</literal> script in the 
      configuration file. This entry specifies the commands to send to tell 
      the proxy server what to connect to. Please see 
index 554a24cf52c52c19a7ca11a23477a61b934d7bc3..c91600ad5388f7cc675922ce731e37ad43faf59e 100644 (file)
@@ -112,23 +112,28 @@ bool FTPConn::Open(pkgAcqMethod *Owner)
    Close();
    
    // Determine the proxy setting
-   if (getenv("ftp_proxy") == 0)
+   string SpecificProxy = _config->Find("Acquire::ftp::Proxy::" + ServerName.Host);
+   if (!SpecificProxy.empty())
    {
-      string DefProxy = _config->Find("Acquire::ftp::Proxy");
-      string SpecificProxy = _config->Find("Acquire::ftp::Proxy::" + ServerName.Host);
-      if (SpecificProxy.empty() == false)
-      {
-        if (SpecificProxy == "DIRECT")
-           Proxy = "";
-        else
-           Proxy = SpecificProxy;
-      }   
-      else
-        Proxy = DefProxy;
+          if (SpecificProxy == "DIRECT")
+                  Proxy = "";
+          else
+                  Proxy = SpecificProxy;
    }
    else
-      Proxy = getenv("ftp_proxy");
-   
+   {
+          string DefProxy = _config->Find("Acquire::ftp::Proxy");
+          if (!DefProxy.empty())
+          {
+                  Proxy = DefProxy;
+          }
+          else
+          {
+                  char* result = getenv("ftp_proxy");
+                  Proxy = result ? result : "";
+          }
+   }
+
    // Parse no_proxy, a , separated list of domains
    if (getenv("no_proxy") != 0)
    {
index 859dbd39c72a19c33ddf422acee2d9be9bde6ab0..7b61973d7c21531c0e243ed96176bb016b77c074 100644 (file)
@@ -311,22 +311,27 @@ bool ServerState::Open()
    Persistent = true;
    
    // Determine the proxy setting
-   if (getenv("http_proxy") == 0)
+   string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host);
+   if (!SpecificProxy.empty())
    {
-      string DefProxy = _config->Find("Acquire::http::Proxy");
-      string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host);
-      if (SpecificProxy.empty() == false)
-      {
-        if (SpecificProxy == "DIRECT")
-           Proxy = "";
-        else
-           Proxy = SpecificProxy;
-      }   
-      else
-        Proxy = DefProxy;
+          if (SpecificProxy == "DIRECT")
+                  Proxy = "";
+          else
+                  Proxy = SpecificProxy;
    }
    else
-      Proxy = getenv("http_proxy");
+   {
+          string DefProxy = _config->Find("Acquire::http::Proxy");
+          if (!DefProxy.empty())
+          {
+                  Proxy = DefProxy;
+          }
+          else
+          {
+                  char* result = getenv("http_proxy");
+                  Proxy = result ? result : "";
+          }
+   }
    
    // Parse no_proxy, a , separated list of domains
    if (getenv("no_proxy") != 0)
index 8bf44b52a995b994f6ba252aa386d1d39d171859..37d93e308dcf11452b0685432317d2d2699c5287 100644 (file)
@@ -61,19 +61,26 @@ void HttpsMethod::SetupProxy()
    URI ServerName = Queue->Uri;
 
    // Determine the proxy setting
-   if (getenv("http_proxy") == 0)
+   string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host);
+   if (!SpecificProxy.empty())
    {
-      string DefProxy = _config->Find("Acquire::http::Proxy");
-      string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host);
-      if (SpecificProxy.empty() == false)
-      {
-        if (SpecificProxy == "DIRECT")
-           Proxy = "";
-        else
-           Proxy = SpecificProxy;
-      }   
-      else
-        Proxy = DefProxy;
+          if (SpecificProxy == "DIRECT")
+                  Proxy = "";
+          else
+                  Proxy = SpecificProxy;
+   }
+   else
+   {
+          string DefProxy = _config->Find("Acquire::http::Proxy");
+          if (!DefProxy.empty())
+          {
+                  Proxy = DefProxy;
+          }
+          else
+          {
+                  char* result = getenv("http_proxy");
+                  Proxy = result ? result : "";
+          }
    }
    
    // Parse no_proxy, a , separated list of domains