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"));
#include "zypp/base/Logger.h"
#include "zypp/base/DefaultIntegral.h"
+#include "zypp/media/MediaAccess.h"
#include "zypp/RepoInfo.h"
{
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);
return m_impl->isValid();
}
- // -----------------------------------------------------------------
- bool
- Url::isLocal() const
- {
- return m_impl->isLocal();
- }
// -----------------------------------------------------------------
std::string
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;
-
// -----------------
/**
#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
return true;
}
- // ---------------------------------------------------------------
- bool
- UrlBase::isLocal() const
- {
- static std::set<std::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
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;
// -----------------
/**