Hello community,
here is the log from the commit of package libzypp for openSUSE:Factory
checked in at Mon Jan 17 17:56:52 CET 2011.
--------
--- libzypp/libzypp.changes 2010-12-10 18:35:32.000000000 +0100
+++ libzypp/libzypp.changes 2011-01-14 13:13:32.000000000 +0100
@@ -1,0 +2,43 @@
+Fri Jan 14 12:45:18 CET 2011 - ma@suse.de
+
+- Add new ServicePlugin Exceptions.
+- version 8.12.0 (10)
+
+-------------------------------------------------------------------
+Thu Jan 13 01:13:32 CET 2011 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Dec 23 14:42:02 CET 2010 - dheidler@suse.de
+
+- add method to check if there are manually configured urls
+- version 8.11.0 (10)
+
+-------------------------------------------------------------------
+Thu Dec 23 11:31:22 CET 2010 - dheidler@suse.de
+
+- create cache directory, if it doesn't exist
+ when saving mirrorlist
+- version 8.10.6 (10)
+
+-------------------------------------------------------------------
+Wed Dec 22 12:38:22 CET 2010 - dheidler@suse.de
+
+- moved keepPackages code to RepoInfo::Impl
+- version 8.10.5 (10)
+
+-------------------------------------------------------------------
+Tue Dec 21 13:29:06 CET 2010 - dheidler@suse.de
+
+- Fix caching of mirrorlist files
+- version 8.10.4 (10)
+
+-------------------------------------------------------------------
+Thu Dec 16 19:46:00 CET 2010 - ma@suse.de
+
+- Do not export keyring if rpmdb is initialised, but target isn't
+ (bnc#659494)
+- version 8.10.3 (10)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libzypp-8.10.2.tar.bz2
New:
----
libzypp-8.12.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.QuvBGs/_old 2011-01-17 17:54:39.000000000 +0100
+++ /var/tmp/diff_new_pack.QuvBGs/_new 2011-01-17 17:54:39.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package libzypp (Version 8.10.2)
+# spec file for package libzypp
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -23,7 +23,7 @@
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Package, Patch, Pattern, and Product Management
-Version: 8.10.2
+Version: 8.12.0
Release: 1
Source: %{name}-%{version}.tar.bz2
Source1: %{name}-rpmlintrc
@@ -42,6 +42,7 @@
BuildRequires: gettext-devel
BuildRequires: graphviz
BuildRequires: libxml2-devel
+BuildRequires: libproxy-devel
BuildRequires: libsatsolver-devel >= 0.14.17
%if 0%{?suse_version}
++++++ libzypp-8.10.2.tar.bz2 -> libzypp-8.12.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/CMakeLists.txt new/libzypp-8.12.0/CMakeLists.txt
--- old/libzypp-8.10.2/CMakeLists.txt 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/CMakeLists.txt 2011-01-17 12:55:51.000000000 +0100
@@ -110,6 +110,14 @@
FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(Udev REQUIRED)
+FIND_PACKAGE(libproxy)
+IF ( NOT LIBPROXY_FOUND )
+ MESSAGE( STATUS " libproxy not found" )
+ELSE ( NOT LIBPROXY_FOUND )
+ INCLUDE_DIRECTORIES( ${LIBPROXY_INCLUDE_DIR} )
+ ADD_DEFINITIONS(-D_WITH_LIBPROXY_SUPPORT_)
+ENDIF( NOT LIBPROXY_FOUND )
+
FIND_PROGRAM( DOXYGEN doxygen )
IF ( NOT DOXYGEN )
MESSAGE( FATAL_ERROR "doxygen not found: install doxygen to build the documentation." )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/VERSION.cmake new/libzypp-8.12.0/VERSION.cmake
--- old/libzypp-8.10.2/VERSION.cmake 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/VERSION.cmake 2011-01-17 12:55:51.000000000 +0100
@@ -60,9 +60,9 @@
#
SET(LIBZYPP_MAJOR "8")
SET(LIBZYPP_COMPATMINOR "10")
-SET(LIBZYPP_MINOR "10")
-SET(LIBZYPP_PATCH "2")
+SET(LIBZYPP_MINOR "12")
+SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 8.10.2 (10)
+# LAST RELEASED: 8.12.0 (10)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/devel/genclass.in new/libzypp-8.12.0/devel/genclass.in
--- old/libzypp-8.10.2/devel/genclass.in 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/devel/genclass.in 2011-01-17 12:55:52.000000000 +0100
@@ -211,7 +211,7 @@
${INDENT}{ return str << *obj._pimpl; }
${INDENT}bool operator==( const ${CLASS} & lhs, const ${CLASS} & rhs )
-${INDENT}{ return lhs._pimpl == rhs_pimpl || lhs._pimpl && rhs_pimpl && *lhs._pimpl == *rhs_pimpl; }
+${INDENT}{ return lhs._pimpl == rhs._pimpl || lhs._pimpl && rhs._pimpl && *lhs._pimpl == *rhs._pimpl; }
$(nsclose)
EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/libzypp.spec.cmake new/libzypp-8.12.0/libzypp.spec.cmake
--- old/libzypp-8.10.2/libzypp.spec.cmake 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/libzypp.spec.cmake 2011-01-17 12:55:51.000000000 +0100
@@ -34,6 +34,7 @@
BuildRequires: gettext-devel
BuildRequires: graphviz
BuildRequires: libxml2-devel
+BuildRequires: libproxy-devel
BuildRequires: libsatsolver-devel >= 0.14.17
%if 0%{?suse_version}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/package/libzypp.changes new/libzypp-8.12.0/package/libzypp.changes
--- old/libzypp-8.10.2/package/libzypp.changes 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/package/libzypp.changes 2011-01-17 12:55:51.000000000 +0100
@@ -1,4 +1,47 @@
-------------------------------------------------------------------
+Fri Jan 14 12:45:18 CET 2011 - ma@suse.de
+
+- Add new ServicePlugin Exceptions.
+- version 8.12.0 (10)
+
+-------------------------------------------------------------------
+Thu Jan 13 01:13:32 CET 2011 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Dec 23 14:42:02 CET 2010 - dheidler@suse.de
+
+- add method to check if there are manually configured urls
+- version 8.11.0 (10)
+
+-------------------------------------------------------------------
+Thu Dec 23 11:31:22 CET 2010 - dheidler@suse.de
+
+- create cache directory, if it doesn't exist
+ when saving mirrorlist
+- version 8.10.6 (10)
+
+-------------------------------------------------------------------
+Wed Dec 22 12:38:22 CET 2010 - dheidler@suse.de
+
+- moved keepPackages code to RepoInfo::Impl
+- version 8.10.5 (10)
+
+-------------------------------------------------------------------
+Tue Dec 21 13:29:06 CET 2010 - dheidler@suse.de
+
+- Fix caching of mirrorlist files
+- version 8.10.4 (10)
+
+-------------------------------------------------------------------
+Thu Dec 16 19:46:00 CET 2010 - ma@suse.de
+
+- Do not export keyring if rpmdb is initialised, but target isn't
+ (bnc#659494)
+- version 8.10.3 (10)
+
+-------------------------------------------------------------------
Fri Dec 10 17:17:07 CET 2010 - dheidler@suse.de
- Catch RPM-Exeption when instaling the Distribution (bnc#658714)
Files old/libzypp-8.10.2/po/zypp-po.tar.bz2 and new/libzypp-8.12.0/po/zypp-po.tar.bz2 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/tests/parser/CMakeLists.txt new/libzypp-8.12.0/tests/parser/CMakeLists.txt
--- old/libzypp-8.10.2/tests/parser/CMakeLists.txt 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/tests/parser/CMakeLists.txt 2011-01-17 12:55:51.000000000 +0100
@@ -3,4 +3,5 @@
ADD_SUBDIRECTORY(ws)
ADD_TESTS( ProductFileReader )
+ADD_TESTS( RepoFileReader )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/tests/parser/RepoFileReader_test.cc new/libzypp-8.12.0/tests/parser/RepoFileReader_test.cc
--- old/libzypp-8.10.2/tests/parser/RepoFileReader_test.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-8.12.0/tests/parser/RepoFileReader_test.cc 2011-01-17 12:55:51.000000000 +0100
@@ -0,0 +1,62 @@
+#include <sstream>
+#include <string>
+#include
+#include
+
+#include "TestSetup.h"
+
+using std::stringstream;
+using std::string;
+using namespace zypp;
+
+static string suse_repo = "[factory-oss]\n"
+"name=factory-oss\n"
+"enabled=1\n"
+"autorefresh=0\n"
+"baseurl=http://download.opensuse.org/factory-tested/repo/oss/\n"
+"type=yast2\n"
+"keeppackages=0\n";
+
+static string fedora_repo = "[fedora]\n"
+"name=Fedora $releasever - $basearch\n"
+"failovermethod=priority\n"
+"#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/\n"
+"#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch\n"
+"mirrorlist=file:///etc/yum.repos.d/local.mirror\n"
+"enabled=1\n"
+"gpgcheck=1\n"
+"gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY\n";
+
+struct RepoCollector : private base::NonCopyable
+{
+ bool collect( const RepoInfo &repo )
+ {
+ repos.push_back(repo);
+ return true;
+ }
+
+ RepoInfoList repos;
+};
+
+// Must be the first test!
+BOOST_AUTO_TEST_CASE(read_repo_file)
+{
+ {
+ stringstream input(suse_repo);
+ RepoCollector collector;
+ parser::RepoFileReader parser( input, bind( &RepoCollector::collect, &collector, _1 ) );
+ BOOST_CHECK_EQUAL(1, collector.repos.size());
+ }
+ // fedora
+ {
+ stringstream input(fedora_repo);
+ RepoCollector collector;
+ parser::RepoFileReader parser( input, bind( &RepoCollector::collect, &collector, _1 ) );
+ BOOST_REQUIRE_EQUAL(1, collector.repos.size());
+
+ RepoInfo repo = *collector.repos.begin();
+ // should have taken the first url if more are present
+ BOOST_CHECK_EQUAL(Url("file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora"), repo.gpgKeyUrl());
+ }
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/CMakeLists.txt new/libzypp-8.12.0/zypp/CMakeLists.txt
--- old/libzypp-8.10.2/zypp/CMakeLists.txt 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/CMakeLists.txt 2011-01-17 12:55:52.000000000 +0100
@@ -324,13 +324,20 @@
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/media
)
+IF ( LIBPROXY_FOUND )
+ SET(zypp_media_proxyinfo_libproxy_SRCS media/proxyinfo/ProxyInfoLibproxy.cc)
+ SET(zypp_media_proxyinfo_libproxy_HEADERS media/proxyinfo/ProxyInfoLibproxy.h)
+ENDIF( LIBPROXY_FOUND )
+
SET( zypp_media_proxyinfo_SRCS
media/proxyinfo/ProxyInfoSysconfig.cc
+ ${zypp_media_proxyinfo_libproxy_SRCS}
)
SET( zypp_media_proxyinfo_HEADERS
media/proxyinfo/ProxyInfoImpl.h
media/proxyinfo/ProxyInfoSysconfig.h
+ ${zypp_media_proxyinfo_libproxy_HEADERS}
media/proxyinfo/ProxyInfos.h
)
@@ -912,6 +919,7 @@
TARGET_LINK_LIBRARIES(zypp ${CRYPTO_LIBRARIES} )
TARGET_LINK_LIBRARIES(zypp ${SIGNALS_LIBRARY} )
TARGET_LINK_LIBRARIES(zypp ${UDEV_LIBRARY} )
+TARGET_LINK_LIBRARIES(zypp ${LIBPROXY_LIBRARIES} )
INSTALL(TARGETS zypp LIBRARY DESTINATION ${LIB_INSTALL_DIR} )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/ExternalProgram.cc new/libzypp-8.12.0/zypp/ExternalProgram.cc
--- old/libzypp-8.10.2/zypp/ExternalProgram.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/ExternalProgram.cc 2011-01-17 12:55:52.000000000 +0100
@@ -617,6 +617,7 @@
{
if ( _buffer.empty() )
return false;
+ break;
}
else if ( errno != EINTR )
return false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/RepoInfo.cc new/libzypp-8.12.0/zypp/RepoInfo.cc
--- old/libzypp-8.10.2/zypp/RepoInfo.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/RepoInfo.cc 2011-01-17 12:55:52.000000000 +0100
@@ -105,6 +105,18 @@
return !emptybaseurls && !_baseUrls.empty();
}
+ /** Compute a resonable default for keepPackages based on URL scheme. */
+ bool keepPackagesDefault() const
+ {
+ if (indeterminate(keeppackages))
+ {
+ if (_baseUrls.empty())
+ return mirrorlist_url.schemeIsDownloading();
+ else
+ return _baseUrls.begin()->schemeIsDownloading();
+ }
+ return (bool) keeppackages;
+ }
public:
TriBool gpgcheck;
@@ -300,20 +312,13 @@
bool RepoInfo::baseUrlsEmpty() const
{ return _pimpl->baseUrls().empty(); }
+ bool RepoInfo::baseUrlSet() const
+ { return _pimpl->baseurl2dump(); }
+
// false by default (if not set by setKeepPackages)
bool RepoInfo::keepPackages() const
{
- if (indeterminate(_pimpl->keeppackages))
- {
- if (_pimpl->baseUrls().empty())
- return false;
- else if ( baseUrlsBegin()->schemeIsDownloading() )
- return true;
- else
- return false;
- }
-
- return (bool) _pimpl->keeppackages;
+ return _pimpl->keepPackagesDefault();
}
///////////////////////////////////////////////////////////////////
@@ -428,7 +433,10 @@
str << "- gpgcheck : " << gpgCheck() << std::endl;
str << "- gpgkey : " << gpgKeyUrl() << std::endl;
- str << "- keeppackages: " << keepPackages() << std::endl;
+
+ if (!indeterminate(_pimpl->keeppackages))
+ str << "- keeppackages: " << keepPackages() << std::endl;
+
str << "- service : " << service() << std::endl;
if (!targetDistribution().empty())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/RepoInfo.h new/libzypp-8.12.0/zypp/RepoInfo.h
--- old/libzypp-8.10.2/zypp/RepoInfo.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/RepoInfo.h 2011-01-17 12:55:52.000000000 +0100
@@ -99,6 +99,10 @@
*/
bool baseUrlsEmpty() const;
/**
+ * whether there are manualy configured repository urls
+ */
+ bool baseUrlSet() const;
+ /**
* number of repository urls
*/
urls_size_type baseUrlsSize() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/MediaCurl.cc new/libzypp-8.12.0/zypp/media/MediaCurl.cc
--- old/libzypp-8.10.2/zypp/media/MediaCurl.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/MediaCurl.cc 2011-01-17 12:55:52.000000000 +0100
@@ -326,10 +326,14 @@
*/
void fillSettingsSystemProxy( const Url&url, TransferSettings &s )
{
+#ifdef _WITH_LIBPROXY_SUPPORT_
+ ProxyInfo proxy_info (ProxyInfo::ImplPtr(new ProxyInfoLibproxy()));
+#else
ProxyInfo proxy_info (ProxyInfo::ImplPtr(new ProxyInfoSysconfig("proxy")));
+#endif
s.setProxyEnabled( proxy_info.useProxyFor( url ) );
if ( s.proxyEnabled() )
- s.setProxy(proxy_info.proxy(url.getScheme()));
+ s.setProxy(proxy_info.proxy(url));
}
Pathname MediaCurl::_cookieFile = "/var/lib/YaST2/cookies";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/ProxyInfo.cc new/libzypp-8.12.0/zypp/media/ProxyInfo.cc
--- old/libzypp-8.10.2/zypp/media/ProxyInfo.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/ProxyInfo.cc 2011-01-17 12:55:52.000000000 +0100
@@ -35,8 +35,8 @@
bool ProxyInfo::enabled() const
{ return _pimpl->enabled(); }
- std::string ProxyInfo::proxy(const std::string & protocol_r) const
- { return _pimpl->proxy(protocol_r); }
+ std::string ProxyInfo::proxy(const Url & url_r) const
+ { return _pimpl->proxy(url_r); }
ProxyInfo::NoProxyList ProxyInfo::noProxy() const
{ return _pimpl->noProxy(); }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/ProxyInfo.h new/libzypp-8.12.0/zypp/media/ProxyInfo.h
--- old/libzypp-8.10.2/zypp/media/ProxyInfo.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/ProxyInfo.h 2011-01-17 12:55:52.000000000 +0100
@@ -42,7 +42,7 @@
/** Ctor */
ProxyInfo(ProxyInfo::ImplPtr pimpl_r);
bool enabled() const;
- std::string proxy(const std::string & protocol_r) const;
+ std::string proxy(const Url & url) const;
NoProxyList noProxy() const;
NoProxyIterator noProxyBegin() const;
NoProxyIterator noProxyEnd() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoImpl.h new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoImpl.h
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoImpl.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoImpl.h 2011-01-17 12:55:52.000000000 +0100
@@ -36,7 +36,7 @@
/** */
virtual bool enabled() const = 0;
/** */
- virtual std::string proxy(const std::string & prorocol_r) const = 0;
+ virtual std::string proxy(const Url & url_r) const = 0;
/** */
virtual ProxyInfo::NoProxyList noProxy() const = 0;
/** */
@@ -47,7 +47,7 @@
/** Return \c true if \ref enabled and \a url_r does not match \ref noProxy. */
bool useProxyFor( const Url & url_r ) const
{
- if ( ! enabled() || proxy( url_r.getScheme() ).empty() )
+ if ( ! enabled() && proxy( url_r ).empty() )
return false;
ProxyInfo::NoProxyList noproxy( noProxy() );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoLibproxy.cc new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoLibproxy.cc
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoLibproxy.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoLibproxy.cc 2011-01-17 12:55:52.000000000 +0100
@@ -0,0 +1,88 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/media/proxyinfo/ProxyInfoLibproxy.cc
+ *
+*/
+
+#include <iostream>
+#include <fstream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/String.h"
+#include "zypp/Pathname.h"
+
+#include "zypp/media/proxyinfo/ProxyInfoLibproxy.h"
+
+using namespace std;
+using namespace zypp::base;
+
+namespace zypp {
+ namespace media {
+
+ ProxyInfoLibproxy::ProxyInfoLibproxy()
+ : ProxyInfo::Impl()
+ {
+ _factory = px_proxy_factory_new();
+ _enabled = !(_factory == NULL);
+ }
+
+ ProxyInfoLibproxy::~ProxyInfoLibproxy()
+ {
+ if (_enabled) {
+ px_proxy_factory_free(_factory);
+ _factory = NULL;
+ _enabled = false;
+ }
+ }
+
+ std::string ProxyInfoLibproxy::proxy(const Url & url_r) const
+ {
+ if (!_enabled)
+ return "";
+
+ const url::ViewOption vopt =
+ url::ViewOption::WITH_SCHEME
+ + url::ViewOption::WITH_HOST
+ + url::ViewOption::WITH_PORT
+ + url::ViewOption::WITH_PATH_NAME;
+
+ char **proxies = px_proxy_factory_get_proxies(_factory,
+ (char *)url_r.asString(vopt).c_str());
+ if (!proxies)
+ return "";
+
+ /* cURL can only handle HTTP proxies, not SOCKS. And can only handle
+ one. So look through the list and find an appropriate one. */
+ char *result = NULL;
+
+ for (int i = 0; proxies[i]; i++) {
+ if (!result &&
+ !strncmp(proxies[i], "http://", 7))
+ result = proxies[i];
+ else
+ free(proxies[i]);
+ }
+ free(proxies);
+
+ if (!result)
+ return "";
+
+ std::string sresult = result;
+ free(result);
+ return sresult;
+ }
+
+ ProxyInfo::NoProxyIterator ProxyInfoLibproxy::noProxyBegin() const
+ { return _no_proxy.begin(); }
+
+ ProxyInfo::NoProxyIterator ProxyInfoLibproxy::noProxyEnd() const
+ { return _no_proxy.end(); }
+
+ } // namespace media
+} // namespace zypp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoLibproxy.h new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoLibproxy.h
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoLibproxy.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoLibproxy.h 2011-01-17 12:55:52.000000000 +0100
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/media/proxyinfo/ProxyInfoLibproxy.h
+ *
+*/
+#ifndef ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
+#define ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
+
+#include <string>
+#include <map>
+
+#include
+
+#include "zypp/base/DefaultIntegral.h"
+#include "zypp/media/ProxyInfo.h"
+#include "zypp/media/proxyinfo/ProxyInfoImpl.h"
+
+namespace zypp {
+ namespace media {
+
+
+ class ProxyInfoLibproxy : public ProxyInfo::Impl
+ {
+ public:
+ ProxyInfoLibproxy();
+ /** */
+ ~ProxyInfoLibproxy();
+ /** */
+ bool enabled() const
+ { return _enabled; }
+ /** */
+ std::string proxy(const Url & url_r) const;
+ /** */
+ ProxyInfo::NoProxyList noProxy() const
+ { return _no_proxy; }
+ /** */
+ virtual ProxyInfo::NoProxyIterator noProxyBegin() const;
+ /** */
+ virtual ProxyInfo::NoProxyIterator noProxyEnd() const;
+ private:
+ DefaultIntegral _enabled;
+ ProxyInfo::NoProxyList _no_proxy;
+ pxProxyFactory *_factory;
+ };
+
+///////////////////////////////////////////////////////////////////
+
+ } // namespace media
+} // namespace zypp
+
+#endif // ZYPP_MEDIA_PROXYINFO_PROXYINFOLIBPROXY_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoSysconfig.cc new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoSysconfig.cc
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoSysconfig.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoSysconfig.cc 2011-01-17 12:55:52.000000000 +0100
@@ -49,9 +49,9 @@
str::split(it->second, std::back_inserter(_no_proxy), ", \t");
}
- std::string ProxyInfoSysconfig::proxy(const std::string & protocol_r) const
+ std::string ProxyInfoSysconfig::proxy(const Url & url_r) const
{
- map::const_iterator it = _proxies.find(protocol_r);
+ map::const_iterator it = _proxies.find(url_r.getScheme());
if (it != _proxies.end())
return it->second;
return "";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoSysconfig.h new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoSysconfig.h
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfoSysconfig.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfoSysconfig.h 2011-01-17 12:55:52.000000000 +0100
@@ -32,7 +32,7 @@
bool enabled() const
{ return _enabled; }
/** */
- std::string proxy(const std::string & protocol_r) const;
+ std::string proxy(const Url & url_r) const;
/** */
ProxyInfo::NoProxyList noProxy() const
{ return _no_proxy; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfos.h new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfos.h
--- old/libzypp-8.10.2/zypp/media/proxyinfo/ProxyInfos.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/media/proxyinfo/ProxyInfos.h 2011-01-17 12:55:52.000000000 +0100
@@ -16,5 +16,8 @@
#include <list>
#include "zypp/media/proxyinfo/ProxyInfoSysconfig.h"
+#ifdef _WITH_LIBPROXY_SUPPORT_
+#include "zypp/media/proxyinfo/ProxyInfoLibproxy.h"
+#endif
#endif // ZYPP_MEDIA_PROXYINFO_PROXYINFOS_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/parser/RepoFileReader.cc new/libzypp-8.12.0/zypp/parser/RepoFileReader.cc
--- old/libzypp-8.10.2/zypp/parser/RepoFileReader.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/parser/RepoFileReader.cc 2011-01-17 12:55:52.000000000 +0100
@@ -68,7 +68,12 @@
else if ( it->first == "mirrorlist" && !it->second.empty())
info.setMirrorListUrl(Url(it->second));
else if ( it->first == "gpgkey" && !it->second.empty())
- info.setGpgKeyUrl( Url(it->second) );
+ {
+ std::vectorstd::string keys;
+ str::split( it->second, std::back_inserter(keys) );
+ if ( ! keys.empty() )
+ info.setGpgKeyUrl( Url(*keys.begin()) );
+ }
else if ( it->first == "gpgcheck" )
info.setGpgCheck( str::strToTrue( it->second ) );
else if ( it->first == "keeppackages" )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/repo/RepoException.cc new/libzypp-8.12.0/zypp/repo/RepoException.cc
--- old/libzypp-8.10.2/zypp/repo/RepoException.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/repo/RepoException.cc 2011-01-17 12:55:52.000000000 +0100
@@ -115,6 +115,7 @@
DEF_CTORS( ServiceInvalidAliasException, "Service has an invalid alias." );
DEF_CTORS( ServiceAlreadyExistsException, "Service already exists." );
DEF_CTORS( ServiceNoUrlException, "Service has no or invalid url defined." );
+ DEF_CTORS( ServicePluginInformalException,"Service plugin has trouble providing the metadata but this should not be treated as error." );
#undef DEF_CTORS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/repo/RepoException.h new/libzypp-8.12.0/zypp/repo/RepoException.h
--- old/libzypp-8.10.2/zypp/repo/RepoException.h 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/repo/RepoException.h 2011-01-17 12:55:52.000000000 +0100
@@ -240,10 +240,21 @@
ServiceNoUrlException( const ServiceInfo & service_r, const std::string & msg_r );
};
+ /** Service plugin has trouble providing the metadata but this should not be treated as error.
+ */
+ class ServicePluginInformalException : public ServiceException
+ {
+ public:
+ ServicePluginInformalException();
+ ServicePluginInformalException( const std::string & msg_r );
+ ServicePluginInformalException( const ServiceInfo & service_r );
+ ServicePluginInformalException( const ServiceInfo & service_r, const std::string & msg_r );
+ };
+
//@}
/////////////////////////////////////////////////////////////////
- } // namespace parser
+ } // namespace repo
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
} // namespace zypp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/repo/RepoMirrorList.cc new/libzypp-8.12.0/zypp/repo/RepoMirrorList.cc
--- old/libzypp-8.10.2/zypp/repo/RepoMirrorList.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/repo/RepoMirrorList.cc 2011-01-17 12:55:52.000000000 +0100
@@ -55,8 +55,11 @@
MediaSetAccess access (abs_url);
tmpfile = access.provideFile(filepath);
- zypp::filesystem::copy(tmpfile, cachefile);
+ // Create directory, if not existing
+ zypp::filesystem::assert_dir(metadatapath);
+
DBG << "Copy MirrorList file to " << cachefile << endl;
+ zypp::filesystem::copy(tmpfile, cachefile);
}
if ( url.asString().find("/metalink") != string::npos )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/repo/ServiceRepos.cc new/libzypp-8.12.0/zypp/repo/ServiceRepos.cc
--- old/libzypp-8.10.2/zypp/repo/ServiceRepos.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/repo/ServiceRepos.cc 2011-01-17 12:55:52.000000000 +0100
@@ -2,6 +2,7 @@
#include <sstream>
#include "zypp/base/Logger.h"
#include "zypp/repo/ServiceRepos.h"
+#include "zypp/repo/RepoException.h"
#include "zypp/media/MediaException.h"
#include "zypp/parser/RepoFileReader.h"
#include "zypp/media/MediaManager.h"
@@ -72,25 +73,29 @@
Url serviceUrl( service.url() );
stringstream buffer;
- // FIXME: Actually we want Stderr to an fd in order to report errors.
- ExternalProgram prog(serviceUrl.getPathName(), ExternalProgram::Discard_Stderr, false, -1, true);
+ ExternalProgram::Arguments args;
+ args.reserve( 3 );
+ args.push_back( "/bin/sh" );
+ args.push_back( "-c" );
+ args.push_back( serviceUrl.getPathName() );
+ ExternalProgramWithStderr prog( args );
prog >> buffer;
- // Services code in zypper is not ready to handle other
- // types of exceptions yet
if ( prog.close() != 0 )
{
- // ignore error but we'd like to report it somehow.
- // ZYPP_THROW(media::MediaException(buffer.str()));
- ERR << "Cpture plugin error: TBI" << endl;
+ // ServicePluginInformalException:
+ // Ignore this error but we'd like to report it somehow...
+ std::string errbuffer;
+ prog.stderrGetUpTo( errbuffer, '\0' );
+ ERR << "Capture plugin error:[" << endl << errbuffer << endl << ']' << endl;
+ ZYPP_THROW( repo::ServicePluginInformalException(errbuffer));
}
+
parser::RepoFileReader parser(buffer, _callback);
}
~PluginServiceRepos()
- {
-
- }
+ {}
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/target/TargetImpl.cc new/libzypp-8.12.0/zypp/target/TargetImpl.cc
--- old/libzypp-8.10.2/zypp/target/TargetImpl.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/target/TargetImpl.cc 2011-01-17 12:55:52.000000000 +0100
@@ -1600,7 +1600,7 @@
try
{
tmprpmdb.reset( new rpm::RpmDb );
- tmprpmdb->initDatabase( "/", Pathname(), false );
+ tmprpmdb->initDatabase( /*default ctor uses / but no additional keyring exports */ );
}
catch( ... )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-8.10.2/zypp/target/rpm/RpmDb.cc new/libzypp-8.12.0/zypp/target/rpm/RpmDb.cc
--- old/libzypp-8.10.2/zypp/target/rpm/RpmDb.cc 2010-12-10 18:09:04.000000000 +0100
+++ new/libzypp-8.12.0/zypp/target/rpm/RpmDb.cc 2011-01-17 12:55:52.000000000 +0100
@@ -305,6 +305,8 @@
///////////////////////////////////////////////////////////////////
// Check arguments
///////////////////////////////////////////////////////////////////
+ bool quickinit( root_r.empty() );
+
if ( root_r.empty() )
root_r = "/";
@@ -318,7 +320,8 @@
}
MIL << "Calling initDatabase: " << stringPath( root_r, dbPath_r )
- << ( doRebuild_r ? " (rebuilddb)" : "" ) << endl;
+ << ( doRebuild_r ? " (rebuilddb)" : "" )
+ << ( quickinit ? " (quickinit)" : "" ) << endl;
///////////////////////////////////////////////////////////////////
// Check whether already initialized
@@ -339,6 +342,13 @@
// init database
///////////////////////////////////////////////////////////////////
librpmDb::unblockAccess();
+
+ if ( quickinit )
+ {
+ MIL << "QUICK initDatabase (no systemRoot set)" << endl;
+ return;
+ }
+
DbStateInfoBits info = DbSI_NO_INIT;
try
{
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org