20 #define LOSETUP_TOOL_PATH "/sbin/losetup"
49 const Pathname &attach_point_hint_r)
54 MIL <<
"MediaISO::MediaISO(" << url_r <<
", "
55 << attach_point_hint_r <<
")" << std::endl;
60 ERR <<
"Media url does not contain iso filename" << std::endl;
75 if( arg.empty() &&
_isofile.dirname().absolute())
77 src = std::string(
"dir:///");
89 ERR <<
"Unable to parse iso filename source media url" << std::endl;
96 ERR <<
"Invalid iso filename source media url" << std::endl;
101 ERR <<
"ISO filename source media url with iso scheme (nested iso): "
114 ERR <<
"ISO filename source media url scheme is not supported: "
133 DBG <<
"Closing parent handler..." << std::endl;
163 string device = out.substr(0, out.size() - 1);
165 DBG <<
"losetup: " << out;
167 if (losetup.
close() != 0)
173 DBG <<
"found " << device << endl;
203 "Unable to find iso filename on source media",
213 if( isofile.empty() || !PathInfo(isofile).isFile())
222 PathInfo dinfo(loopdev);
225 media->maj_nr = dinfo.major();
226 media->min_nr = dinfo.minor();
229 ERR << loopdev <<
" is not a block device" << endl;
236 DBG <<
"Using a shared media "
251 if( mountpoint.empty())
256 std::string mountopts(
"ro,loop=" + loopdev);
259 mount.
mount(isofile.asString(), mountpoint,
268 while( !(mountsucceeded=
isAttached()) && --limit)
286 "Unable to verify that the media was mounted",
287 isofile.asString(), mountpoint
311 WAR <<
"Not been able to cleanup the parent mount." << endl;
327 bool recurse_r)
const
334 const Pathname &dirname,
342 const Pathname &dirname,
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
std::string encode(const std::string &str, const std::string &safe, EEncoding eflag)
Encodes a string using URL percent encoding.
Base class for all URL exceptions.
bool isValid() const
Verifies the Url.
std::string asString() const
Returns a default string representation of the Url object.
void remember(const Exception &old_r)
Store an other Exception as history.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
std::list< DirEntry > DirContent
Returned by readdir.
#define URL_SAFE_CHARS
Characters that are safe for URL without percent-encoding.
std::string receiveLine()
Read one line from the input stream.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string asString(const Patch::SeverityFlag &obj)
int close()
Wait for the progamm to complete.
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
Base class for Exception.
Pathname expandlink(const Pathname &path_r)
Recursively follows the symlink pointed to by path_r and returns the Pathname to the real file or dir...
std::string getScheme() const
Returns the scheme name of the URL.