16#include <zypp/base/Logger.h>
17#include <zypp/base/String.h>
19#include <zypp-media/Mount>
43 const Pathname & attach_point_hint_r )
48 MIL <<
"MediaNFS::MediaNFS(" << url_r <<
", " << attach_point_hint_r <<
")" << endl;
77 DBG <<
"Using a shared media "
107 std::vector<std::string> optionList;
108 str::split( options, std::back_inserter(optionList),
"," );
109 std::vector<std::string>::const_iterator it;
110 bool contains_lock =
false, contains_soft =
false,
111 contains_timeo =
false, contains_hard =
false;
113 for( it = optionList.begin(); it != optionList.end(); ++it ) {
114 if ( *it ==
"lock" || *it ==
"nolock" ) contains_lock =
true;
115 else if ( *it ==
"soft") contains_soft =
true;
116 else if ( *it ==
"hard") contains_hard =
true;
117 else if ( it->find(
"timeo") != std::string::npos ) contains_timeo =
true;
120 if ( !(contains_lock && contains_soft) ) {
124 if ( !contains_lock ) {
125 optionList.push_back(
"nolock" );
132 if ( !(contains_soft || contains_hard) ) {
133 optionList.push_back(
"soft" );
134 if ( !contains_timeo ) {
135 std::ostringstream s;
137 optionList.push_back( s.str() );
152 while( !(mountsucceeded=
isAttached()) && --limit)
169 "Unable to verify that the media was mounted",
235 const Pathname & dirname,
bool dots )
const
249 const Pathname & dirname,
bool dots )
const
std::string getScheme() const
Returns the scheme name of the URL.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string getHost(EEncoding eflag=zypp::url::E_DECODED) const
Returns the hostname or IP from the URL authority.
const std::string & asString() const
String representation.
std::list< DirEntry > DirContent
Returned by readdir.
std::string join(TIterator begin, TIterator end, const C_Str &sep_r=" ")
Join strings using separator sep_r (defaults to BLANK).
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Easy-to use interface to the ZYPP dependency resolver.
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.