15#include <zypp-media/Mount>
47 origin_r.authority().
url().getPathName(),
50 MIL <<
"MediaISO::MediaISO(" <<
_origin.authority().
url() <<
", "
51 << attach_point_hint_r <<
")" << std::endl;
56 ERR <<
"Media url does not contain iso filename" << std::endl;
57 ZYPP_THROW(MediaBadUrlEmptyDestinationException(_origin.authority().url()));
66 const std::string & arg { _origin.authority().url().getQueryParam(
"url") };
69 src.setPathName( _isofile.dirname() );
70 _isofile = _isofile.basename();
78 ERR <<
"Unable to parse iso filename source media url" << std::endl;
79 MediaBadUrlException ne(_origin.authority().url());
86 ERR <<
"Invalid iso filename source media url" << std::endl;
87 ZYPP_THROW(MediaBadUrlException(src));
89 if( src.getScheme() ==
"iso")
91 ERR <<
"ISO filename source media url with iso scheme (nested iso): "
92 << src.asString() << std::endl;
93 ZYPP_THROW(MediaUnsupportedUrlSchemeException(src));
96 if( !(src.getScheme() ==
"hd" ||
97 src.getScheme() ==
"dir" ||
98 src.getScheme() ==
"file" ||
99 src.getScheme() ==
"nfs" ||
100 src.getScheme() ==
"nfs4" ||
101 src.getScheme() ==
"smb" ||
102 src.getScheme() ==
"cifs"))
104 ERR <<
"ISO filename source media url scheme is not supported: "
105 << src.asString() << std::endl;
106 ZYPP_THROW(MediaUnsupportedUrlSchemeException(src));
111 _parentId = manager.
open({MirroredOrigin(src)}, _origin.authority().url().getQueryParam(
"mnt"));
123 DBG <<
"Closing parent handler..." << std::endl;
167 "Unable to find iso filename on source media",
189 DBG <<
"Using a shared media "
205 std::string mountopts(
"ro,loop");
216 bool mountsucceeded =
false;
217 while( !(mountsucceeded=
isAttached()) && --limit)
235 "Unable to verify that the media was mounted",
260 WAR <<
"Not been able to cleanup the parent mount." << endl;
276 bool recurse_r)
const
Base class for Exception.
void remember(const Exception &old_r)
Store an other Exception as history.
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
Wrapper class for stat/lstat.
const std::string & asString() const
String representation.
bool empty() const
Test for an empty path.
Base class for all URL exceptions.
std::list< DirEntry > DirContent
Returned by readdir.
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.