32 MediaSetAccess::MediaSetAccess(
const Url &
url,
33 const Pathname & prefered_attach_point)
35 , _prefAttachPoint(prefered_attach_point)
40 const Pathname & prefered_attach_point)
42 , _prefAttachPoint(prefered_attach_point)
86 DBG <<
"Going to release file " << file
87 <<
" from media number " << media_nr << endl;
96 bool dots,
unsigned media_nr )
106 media_mgr.
dirInfo(media, retlist, dirname, dots);
163 provide( boost::ref(op), resource, options, deltafile );
194 url.setPathName (
"/");
232 ProvideFileOptions options,
236 unsigned media_nr(resource.
medianr());
247 bool deltafileset =
false;
251 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
252 <<
" from media number " << media_nr << endl;
268 unsigned int devindex = 0;
269 vector<string> devices;
276 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
284 MIL <<
"Failed to release media " << media << endl;
312 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
320 user =
report->requestMedia (
331 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
335 DBG <<
"Aborting" << endl;
336 AbortRequestException aexcp(
"Aborting requested by user");
337 aexcp.remember(excp);
342 DBG <<
"Skipping" << endl;
343 SkipRequestException nexcp(
"User-requested skipping of a file");
344 nexcp.remember(excp);
349 DBG <<
"Eject: try to release" << endl;
353 media_mgr.
release (media, devindex < devices.size() ? devices[devindex] :
"");
364 DBG <<
"Going to try again" << endl;
366 media_mgr.
close(media);
375 DBG <<
"Don't know, let's ABORT" << endl;
388 ProvideFileOptions options )
431 WAR <<
"Verifier not found" << endl;
441 if (scheme ==
"cd" || scheme ==
"dvd")
444 DBG <<
"Rewriting url " << url_r << endl;
459 url.setQueryParam(
"iso", isofile);
460 DBG <<
"Url rewrite result: " <<
url << endl;
473 url.setPathName(pathname);
474 DBG <<
"Url rewrite result: " <<
url << endl;
483 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
485 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
486 manager.
release(m->second,
"");
std::string getScheme() const
Returns the scheme name of the URL.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Store and operate with byte count.
String related utilities and Regular expression matching.
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
ProvideFileExistenceOperation()
void operator()(media::MediaAccessId media, const Pathname &file)
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
Do not differentiate case.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
const std::string & asString() const
String representation.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
std::list< DirEntry > DirContent
Returned by readdir.
int hardlinkCopy(const Pathname &oldpath, const Pathname &newpath)
Create newpath as hardlink or copy of oldpath.
void operator()(media::MediaAccessId media, const Pathname &file)
std::string numstring(char n, int w=0)
ByteCount expectedFileSize
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
Regular expression match result.
Base class for Exception.
void operator()(media::MediaAccessId media, const Pathname &file)
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
Wrapper for const correct access via Smart pointer types.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
void operator()(media::MediaAccessId media, const Pathname &file)
Easy-to use interface to the ZYPP dependency resolver.
#define IMPL_PTR_TYPE(NAME)
static ManagedFile asManagedFile()
Create a temporary file and convert it to a automatically cleaned up ManagedFile. ...