From 788a8f42c1ec146c812550d076e5fb720e83ae52 Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Mon, 15 Dec 2008 21:17:39 +0200 Subject: Make apt proxy options have the highest priority, unified proxy determining code. --- configure.in | 2 +- debian/changelog | 6 ++++++ doc/apt.conf.5.xml | 15 ++++++++++----- methods/ftp.cc | 33 +++++++++++++++++++-------------- methods/http.cc | 31 ++++++++++++++++++------------- methods/https.cc | 31 +++++++++++++++++++------------ 6 files changed, 73 insertions(+), 45 deletions(-) diff --git a/configure.in b/configure.in index f90a32c3b..04d8a4712 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +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.20~exp3") +AC_DEFINE_UNQUOTED(VERSION,"0.7.20") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index 90be66400..304e0fb2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,12 @@ apt (0.7.20) unstable; urgency=low - Mentioned 'APT::Periodic' and 'APT::Archives' groups of options. (Closes: #438559) - Mentioned '/* ... */' comments. (Closes: #507601) + * 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[::]' 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 ] * make "apt-get build-dep" installed packages marked automatic diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 74966c5b3..4d9e708a8 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -202,8 +202,9 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; standard form of http://[[user][:pass]@]host[:port]/. Per host proxies can also be specified by using the form http::Proxy::<host> with the special keyword DIRECT - meaning to use no proxies. The http_proxy environment variable - will override all settings. + meaning to use no proxies. If no one of the above settings is specified, + http_proxy environment variable + will be used. Three settings are provided for cache control with HTTP/1.1 compliant proxy caches. No-Cache tells the proxy to not use its cached @@ -251,9 +252,13 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; ftp - FTP URIs; ftp::Proxy is the default proxy server to use. It is in the - standard form of ftp://[[user][:pass]@]host[:port]/ and is - overridden by the ftp_proxy environment variable. To use a ftp + FTP URIs; ftp::Proxy is the default ftp proxy to use. It is in the + standard form of ftp://[[user][:pass]@]host[:port]/. Per + host proxies can also be specified by using the form + ftp::Proxy::<host> with the special keyword DIRECT + meaning to use no proxies. If no one of the above settings is specified, + ftp_proxy environment variable + will be used. To use a ftp proxy you will have to set the ftp::ProxyLogin script in the configuration file. This entry specifies the commands to send to tell the proxy server what to connect to. Please see diff --git a/methods/ftp.cc b/methods/ftp.cc index 554a24cf5..c91600ad5 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -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) { diff --git a/methods/http.cc b/methods/http.cc index b3c791fa0..5d18b3adc 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -309,22 +309,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) diff --git a/methods/https.cc b/methods/https.cc index 98dfeefa1..728869fa2 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -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 -- cgit v1.2.3 From 1d39ef1994ae82f5f6d78e2be75ce0afb498aae8 Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Mon, 15 Dec 2008 23:49:08 +0200 Subject: debian/changelog: updated date --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5b57c96a3..fa3ecf018 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,7 +31,7 @@ apt (0.7.20) unstable; urgency=low * Translations: - Finnish updated. Closes: #508449 - -- Eugene V. Lyubimkin Sat, 06 Dec 2008 20:57:00 +0200 + -- Eugene V. Lyubimkin Mon, 15 Dec 2008 23:48:46 +0200 apt (0.7.20~exp2) unstable; urgency=low -- cgit v1.2.3 From 4343b16d476ba388fa3475c96627e2a14a2d0f6d Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Thu, 18 Dec 2008 00:28:03 +0200 Subject: Fixed typo in changelog. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fa3ecf018..285c11922 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,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. -- cgit v1.2.3 From 629e1b39213b59d41c35a18a04278507b1630083 Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Thu, 18 Dec 2008 00:35:00 +0200 Subject: Noted in NEWS.Debian changes in determining proxy algorithm. --- debian/NEWS.Debian | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian index f44d1966b..5730fd7c6 100644 --- a/debian/NEWS.Debian +++ b/debian/NEWS.Debian @@ -1,3 +1,12 @@ +apt (0.7.20) unstable; urgency=low + + * Code that determines which proxy to use was changed. Now + 'Acquire::{http,ftp}::Proxy[::]' options have the highest priority, + and '{http,ftp}_proxy' environment variables are used only if options + mentioned above are not specified. + + -- Eugene V. Lyubimkin Thu, 18 Dec 2008 00:30:16 +0200 + apt (0.6.44) unstable; urgency=low * apt-ftparchive --db now uses Berkeley DB_BTREE instead of DB_HASH. -- cgit v1.2.3 From 074d72ebefa42e8b2bea2062114a44cd0445bfad Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Thu, 18 Dec 2008 00:36:27 +0200 Subject: Rename: 'debian/NEWS.Debian' => 'debian/NEWS' to make the file recognizeable by debhelper and, so, installed. --- debian/NEWS | 27 +++++++++++++++++++++++++++ debian/NEWS.Debian | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 debian/NEWS delete mode 100644 debian/NEWS.Debian diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 000000000..5730fd7c6 --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,27 @@ +apt (0.7.20) unstable; urgency=low + + * Code that determines which proxy to use was changed. Now + 'Acquire::{http,ftp}::Proxy[::]' options have the highest priority, + and '{http,ftp}_proxy' environment variables are used only if options + mentioned above are not specified. + + -- Eugene V. Lyubimkin Thu, 18 Dec 2008 00:30: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 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 Sat, 8 May 2004 12:38:07 -0700 + diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian deleted file mode 100644 index 5730fd7c6..000000000 --- a/debian/NEWS.Debian +++ /dev/null @@ -1,27 +0,0 @@ -apt (0.7.20) unstable; urgency=low - - * Code that determines which proxy to use was changed. Now - 'Acquire::{http,ftp}::Proxy[::]' options have the highest priority, - and '{http,ftp}_proxy' environment variables are used only if options - mentioned above are not specified. - - -- Eugene V. Lyubimkin Thu, 18 Dec 2008 00:30: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 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 Sat, 8 May 2004 12:38:07 -0700 - -- cgit v1.2.3 From bbf55f8c66325fd0d9262730fb7af25fa25d2c5f Mon Sep 17 00:00:00 2001 From: "Eugene V. Lyubimkin" Date: Sun, 21 Dec 2008 16:01:31 +0200 Subject: Actualized COPYING file. --- COPYING | 151 ++++++------------------------------------------------- debian/changelog | 3 ++ 2 files changed, 19 insertions(+), 135 deletions(-) diff --git a/COPYING b/COPYING index 3baf9ac5a..bba1b752b 100644 --- a/COPYING +++ b/COPYING @@ -1,142 +1,23 @@ Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others. +Apt is currently developed by APT Development Team . -Apt is licensed under the terms of the GNU General Public License (GPL), -version 2.0 or later, as published by the Free Software Foundation. See -the file COPYING.GPL [included], /usr/share/common-licenses/GPL, or - for the terms of the latest version -of the GNU General Public License. - -In addition, prior to November 15th, 2000, apt may be distributed under -terms identical to the above with the following addition: - -Works using apt may link against the GUI library "libqt", copyright by -Troll Tech AS, Norway, provided that: - -1. The version of "libqt" is licensed under the terms of the "Qt Free Edition - License" published by Troll Tech AS. The license terms identified as - the Qt Free Edition License below are the only such terms under which - distribution of works derived from both apt and "libqt" are permitted; - -and - -2. The source code of the version of "libqt" used is - - a) Distributed with the binary version; - - or - - b) Downloadable by anyone, without fee, using a publicly-announced - URL on the Internet, for a duration of at least three years - starting with distribution of the binary version. - -On and after November 15th, 2000, the above additional terms lose all -force, and apt will be licensed only under the terms of the GNU General -Public License, version 2.0 or later. - - _______________________________________________________________ - -The following text, up to the text of the Qt Free Edition License, is -informational and not part of the license terms on apt. - -Modifications to apt in either source or compiled form must be licensed -under the terms of the GNU General Public License, version 2.0 (or later), -but need not include the above clause permitting usage of the "libqt" -library under the Qt Free Edition License. Note that removal of this -clause will result in software which is not licensed for binary -redistribution linked against software governed by the Qt Free Edition -License. In the event that a version of "libqt" is released that is -licensed under terms that do not conflict with the GPL, the additional -clause above is not required to grant permission for distribution of works -that are derived from both apt and "libqt". - -No part of apt is licensed under the Qt Free Edition License. The terms -below are provided to help identify the circumstances under which the -"libqt" library may be used with apt (or a work derived from both). The -terms below are copied from the LICENSE file of the qt-1.44 distribution, -as of November 10th, 1999. - - _______________________________________________________________ - - QT FREE EDITION LICENSE +License: GPLv2+ -Copyright (C) 1992-1999 Troll Tech AS. All rights reserved. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This is the license for Qt Free Edition version 1.44; it covers private use, -use of third-party application programs based on Qt, and development of -free software for the free software community. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - COPYRIGHT AND RESTRICTIONS - -The Qt toolkit is a product of Troll Tech AS. The Qt Free Edition is limited -to use with the X Window System. - -You may copy this version of the Qt Free Edition provided that the entire -archive is distributed unchanged and as a whole, including this notice. - -You may use this version of the Qt Free Edition to compile, link and run -application programs legally developed by third parties. - -You may use the Qt Free Edition to create application programs -provided that: - - You accept this license. - Your software does not require modifications to Qt Free Edition. - You satisfy ONE of the following three requirements - EITHER - Users of your software can freely obtain source code for the - software, freely modify the source code (possibly with - restrictions on copyright notices, attributions and legal - responsibility), and freely redistribute original or modified - versions of the software. - OR - Your software is distributed under the GNU GENERAL - PUBLIC LICENSE, version 2 or later, as defined by the - Free Software Foundation. - OR - Your software is distributed under the GNU LIBRARY - GENERAL PUBLIC LICENSE, version 2 or later, as - defined by the Free Software Foundation. - -If you are paid to develop something with Qt Free Edition or it is a part of -your job the following conditions also apply: - - Your software must not require libraries, programs, data or - documentation that are not available outside your organization in - order to compile or use. - If and when your organization starts using the software, you must - notify Troll Tech AS of the following: - Your organization's name and purpose. - The software's name and purpose. - The software's license. - That your organization considers the software to be free - software. - -You may also use the Qt Free Edition to create reusable components -(such as libraries) provided that you accept the terms above, and in -addition that: - - Your components' license includes the following text: - - [Your package] requires the Qt library, which is - copyright Troll Tech AS. Freely distributable - programs may generally use Qt Free Edition free of - charge, see [README.QT] for details. - - README.QT is distributed along with your components. - Qt Free Edition is not distributed as an integral part of your - components. - - LIMITATIONS OF LIABILITY - -Troll Tech AS makes no obligation under this license to support or -upgrade Qt Free Edition, or assist in the use of Qt Free Edition. - -In no event shall Troll Tech AS be liable for any lost revenue or profits or -other direct, indirect, special, incidental or consequential damages, even -if Troll Tech has been advised of the possibility of such damages. +See /usr/share/common-licenses/GPL-2, or + for the terms of the latest version +of the GNU General Public License. -QT FREE EDITION IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, -INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. - _______________________________________________________________ diff --git a/debian/changelog b/debian/changelog index 0adbbac1b..758d7a4bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,9 @@ apt (0.7.20) unstable; urgency=low and '{http,ftp}_proxy' environment variables are used only if options mentioned above are not specified. (Closes: #445985, #157759, #320184, #365880, #479617) + * COPYING: + - Actualized. Removed obsolete Qt section, added GPLv2 clause. + (Closes: #440049, #509337) [ Michael Vogt ] * add option to "apt-get build-dep" to mark the needed -- cgit v1.2.3