19#include <zypp-media/Mount>
43 const Pathname & attach_point_hint_r )
48 MIL <<
"MediaNFS::MediaNFS(" << origin_r.
authority().
url() <<
", " << attach_point_hint_r <<
")" << endl;
61 if(
_origin.authority().url().getHost().empty())
66 std::string path =
_origin.authority().url().getHost();
77 DBG <<
"Using a shared media "
96 if (
filesystem !=
"nfs4" &&
_origin.authority().url().getQueryParam(
"type") ==
"nfs4" )
101 std::string options =
_origin.authority().url().getQueryParam(
"mountoptions");
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() );
151 bool mountsucceeded =
false;
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
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
const OriginEndpoint & authority() const
const std::string & asString() const
String representation.
Types and functions for filesystem operations.
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.
std::string asString(const Patch::Category &obj)
#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.