33 const Pathname & prefered_attach_point)
35 , _prefAttachPoint(prefered_attach_point)
40 const Pathname & prefered_attach_point)
42 , _prefAttachPoint(prefered_attach_point)
51 for (
const auto & mm :
_medias )
52 manager.
close( mm.second );
88 DBG <<
"Going to release file " << file
89 <<
" from media number " << media_nr << endl;
98 bool dots,
unsigned media_nr )
108 media_mgr.
dirInfo(media, retlist, dirname, dots);
165 provide( boost::ref(op), resource, options, deltafile );
236 for (
const auto &resource : files ) {
238 unsigned media_nr(resource.medianr());
241 if ( !media_mgr.
isOpen( media ) ) {
242 MIL <<
"Skipping precache of file " << resource.filename() <<
" media is not open";
255 ProvideFileOptions options,
259 unsigned media_nr(resource.
medianr());
270 bool deltafileset =
false;
274 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
275 <<
" from media number " << media_nr << endl;
291 unsigned int devindex = 0;
292 std::vector<std::string> devices;
299 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
307 MIL <<
"Failed to release media " << media << endl;
335 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
343 user = report->requestMedia (
354 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
358 DBG <<
"Aborting" << endl;
359 AbortRequestException aexcp(
"Aborting requested by user");
360 aexcp.remember(excp);
365 DBG <<
"Skipping" << endl;
366 SkipRequestException nexcp(
"User-requested skipping of a file");
367 nexcp.remember(excp);
372 DBG <<
"Eject: try to release" << endl;
376 media_mgr.
release (media, devindex < devices.size() ? devices[devindex] :
"");
387 DBG <<
"Going to try again" << endl;
389 media_mgr.
close(media);
398 DBG <<
"Don't know, let's ABORT" << endl;
411 ProvideFileOptions options )
454 WAR <<
"Verifier not found" << endl;
464 if (scheme ==
"cd" || scheme ==
"dvd")
467 DBG <<
"Rewriting url " << url_r << endl;
483 DBG <<
"Url rewrite result: " << url << endl;
497 DBG <<
"Url rewrite result: " << url << endl;
506 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
508 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
509 manager.
release(m->second,
"");
std::string getScheme() const
Returns the scheme name of the URL.
void setQueryParam(const std::string ¶m, const std::string &value)
Set or add value for the specified query parameter.
#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.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
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.
IMPL_PTR_TYPE(Application)
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.
static ManagedFile asManagedFile()
Create a temporary file and convert it to a automatically cleaned up ManagedFile. ...