Author: jreidinger Date: Tue May 6 14:58:06 2008 New Revision: 9957 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9957&view=rev Log: revert isLocal metod and use downloads instead to decide when cache packages. Modified: trunk/libzypp/tests/zypp/RepoManager_test.cc trunk/libzypp/zypp/RepoInfo.cc trunk/libzypp/zypp/Url.cc trunk/libzypp/zypp/Url.h trunk/libzypp/zypp/url/UrlBase.cc trunk/libzypp/zypp/url/UrlBase.h Modified: trunk/libzypp/tests/zypp/RepoManager_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/RepoManager_te... ============================================================================== --- trunk/libzypp/tests/zypp/RepoManager_test.cc (original) +++ trunk/libzypp/tests/zypp/RepoManager_test.cc Tue May 6 14:58:06 2008 @@ -146,7 +146,7 @@ repo.setBaseUrl(string("ftp://test.org")); BOOST_CHECK_MESSAGE( repo.keepPackages(), "ftp scheme is not cached"); repo.setBaseUrl(string("smb://test.org")); - BOOST_CHECK_MESSAGE( repo.keepPackages(), "smb scheme is not cached"); + BOOST_CHECK_MESSAGE( !repo.keepPackages(), "smb scheme is cached"); repo.setBaseUrl(string("file:///test.txt")); BOOST_CHECK_MESSAGE( !repo.keepPackages(), "file scheme is cached"); repo.setBaseUrl(string("http://test.org")); Modified: trunk/libzypp/zypp/RepoInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoInfo.cc?rev=9957... ============================================================================== --- trunk/libzypp/zypp/RepoInfo.cc (original) +++ trunk/libzypp/zypp/RepoInfo.cc Tue May 6 14:58:06 2008 @@ -13,6 +13,7 @@ #include "zypp/base/Logger.h" #include "zypp/base/DefaultIntegral.h" +#include "zypp/media/MediaAccess.h" #include "zypp/RepoInfo.h" @@ -148,10 +149,10 @@ { if ( _pimpl->baseUrls.size()==0 ) //first url { - if ( url.isLocal() ) - setKeepPackages(false); - else + if ( media::MediaAccess::downloads( url ) ) setKeepPackages(true); + else + setKeepPackages(false); } _pimpl->baseUrls.insert(url); Modified: trunk/libzypp/zypp/Url.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Url.cc?rev=9957&... ============================================================================== --- trunk/libzypp/zypp/Url.cc (original) +++ trunk/libzypp/zypp/Url.cc Tue May 6 14:58:06 2008 @@ -445,12 +445,6 @@ return m_impl->isValid(); } - // ----------------------------------------------------------------- - bool - Url::isLocal() const - { - return m_impl->isLocal(); - } // ----------------------------------------------------------------- std::string Modified: trunk/libzypp/zypp/Url.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Url.h?rev=9957&r... ============================================================================== --- trunk/libzypp/zypp/Url.h (original) +++ trunk/libzypp/zypp/Url.h Tue May 6 14:58:06 2008 @@ -259,17 +259,6 @@ bool isValid() const; - /** - * \brief Gets if url uses local network or pc scheme. - * - * Looks if url use local network scheme or uses internet - * scheme like http, ftp, smb. - * - * \return True if url uses local network or pc scheme - */ - bool - isLocal() const; - // ----------------- /** Modified: trunk/libzypp/zypp/url/UrlBase.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/url/UrlBase.cc?rev=9... ============================================================================== --- trunk/libzypp/zypp/url/UrlBase.cc (original) +++ trunk/libzypp/zypp/url/UrlBase.cc Tue May 6 14:58:06 2008 @@ -22,7 +22,6 @@ #include <arpa/inet.h> #include <iostream> -#include <set> // in the Estonian locale, a-z excludes t, for example. #302525 // http://en.wikipedia.org/wiki/Estonian_alphabet @@ -429,30 +428,6 @@ return true; } - // --------------------------------------------------------------- - bool - UrlBase::isLocal() const - { - static std::setstd::string remote; - if (remote.empty()) //fill set - { - remote.insert("http"); - remote.insert("ftp"); - remote.insert("smb"); - remote.insert("ldap"); - remote.insert("ldaps"); - remote.insert("https"); - remote.insert("sftp"); - remote.insert("cifs"); - } - - if ( remote.find(getScheme())!=remote.end() ) - { - return false; - } - - return true; - } // --------------------------------------------------------------- std::string Modified: trunk/libzypp/zypp/url/UrlBase.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/url/UrlBase.h?rev=99... ============================================================================== --- trunk/libzypp/zypp/url/UrlBase.h (original) +++ trunk/libzypp/zypp/url/UrlBase.h Tue May 6 14:58:06 2008 @@ -400,16 +400,6 @@ virtual bool isValid() const; - /** - * \brief Gets if url uses local network or pc scheme. - * - * Looks if url use local network scheme or uses internet - * scheme like http, ftp, smb. - * - * \return True if url uses local network or pc scheme - */ - virtual bool - isLocal() const; // ----------------- /** -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org