if ( !_url.isValid() )
ZYPP_THROW(MediaBadUrlException(_url));
+ if( attachPoint().empty() || attachPoint().asString() == "/")
+ {
+ std::string mountpoint = createAttachPoint().asString();
+ if( mountpoint.empty())
+ ZYPP_THROW( MediaBadAttachPointException(url()));
+ setAttachPoint( mountpoint, true);
+ }
+
_curl = curl_easy_init();
if ( !_curl ) {
ZYPP_THROW(MediaCurlInitException(_url));
ZYPP_THROW(MediaBadUrlEmptyFilesystemException(url()));
Mount mount;
- const char *mountpoint = attachPoint().asString().c_str();
+ std::string mountpoint = attachPoint().asString();
+ if( mountpoint.empty() || mountpoint == "/")
+ {
+ mountpoint = createAttachPoint().asString();
+ if( mountpoint.empty())
+ ZYPP_THROW( MediaBadAttachPointException(url()));
+ setAttachPoint( mountpoint, true);
+ }
+
string options = _url.getQueryParam("mountoptions");
if(options.empty())
{
options="ro";
}
- mount.mount(_device,mountpoint,_filesystem,options);
+ mount.mount(_device,mountpoint.c_str(),_filesystem,options);
}
PathInfo adir( attach_point_r );
// FIXME: verify if attach_point_r isn't a mountpoint of other device
- if ( attach_point_r.asString() == "/" || !adir.isDir() ) {
+ if ( !adir.isDir() ) {
ERR << "Provided attach point is not a directory: " << adir << endl;
}
else {
ZYPP_THROW(MediaNotSupportedException(_url));
const char* const filesystem = "nfs";
- const char *mountpoint = attachPoint().asString().c_str();
+ std::string mountpoint = attachPoint().asString();
Mount mount;
-
+
+ if( mountpoint.empty() || mountpoint == "/")
+ {
+ mountpoint = createAttachPoint().asString();
+ if( mountpoint.empty())
+ ZYPP_THROW( MediaBadAttachPointException(url()));
+ setAttachPoint( mountpoint, true);
+ }
+
string path = _url.getHost();
path += ':';
path += _url.getPathName();
options = str::join( optionList, "," );
}
- mount.mount(path,mountpoint,filesystem,options);
+ mount.mount(path,mountpoint.c_str(),filesystem,options);
}
if(next)
ZYPP_THROW(MediaNotSupportedException(_url));
- const char *mountpoint = attachPoint().asString().c_str();
+ std::string mountpoint = attachPoint().asString();
+ if( mountpoint.empty() || mountpoint == "/")
+ {
+ mountpoint = createAttachPoint().asString();
+ if( mountpoint.empty())
+ ZYPP_THROW( MediaBadAttachPointException(url()));
+ setAttachPoint( mountpoint, true);
+ }
+
Mount mount;
-
+
string path = "//";
path += _url.getHost() + "/" + getShare( _url.getPathName() );
//
//////////////////////////////////////////////////////
- mount.mount( path, mountpoint, _vfstype,
+ mount.mount( path, mountpoint.c_str(), _vfstype,
options.asString(), environment );
}