31 MediaSetAccess::MediaSetAccess(
const Url &
url,
32 const Pathname & prefered_attach_point)
34 , _prefAttachPoint(prefered_attach_point)
39 const Pathname & prefered_attach_point)
85 DBG <<
"Going to release file " << file
86 <<
" from media number " << media_nr << endl;
95 bool dots,
unsigned media_nr )
105 media_mgr.
dirInfo(media, retlist, dirname, dots);
115 media_mgr.
provideFile(media, file, expectedFileSize);
116 result = media_mgr.
localPath(media, file);
127 result = media_mgr.
localPath(media, file);
138 result = media_mgr.
localPath(media, file);
162 provide( boost::ref(op), resource, options, deltafile );
171 provide( boost::ref(op), resource, options, Pathname() );
200 ProvideFileOptions options,
201 const Pathname &deltafile )
204 unsigned media_nr(resource.
medianr());
215 bool deltafileset =
false;
219 DBG <<
"Going to try to provide " << (resource.
optional() ?
"optional" :
"") <<
" file " << file
220 <<
" from media number " << media_nr << endl;
236 unsigned int devindex = 0;
237 vector<string> devices;
244 DBG <<
"Media couldn't provide file " << file <<
" , releasing." << endl;
252 MIL <<
"Failed to release media " << media << endl;
280 MIL <<
"Can't provide file. Non-Interactive mode." << endl;
288 user = report->requestMedia (
299 MIL <<
"ProvideFile exception caught, callback answer: " << user << endl;
303 DBG <<
"Aborting" << endl;
304 AbortRequestException aexcp(
"Aborting requested by user");
305 aexcp.remember(excp);
310 DBG <<
"Skipping" << endl;
311 SkipRequestException nexcp(
"User-requested skipping of a file");
312 nexcp.remember(excp);
317 DBG <<
"Eject: try to release" << endl;
321 media_mgr.
release (media, devindex < devices.size() ? devices[devindex] :
"");
332 DBG <<
"Going to try again" << endl;
334 media_mgr.
close(media);
343 DBG <<
"Don't know, let's ABORT" << endl;
356 ProvideFileOptions options )
363 provide( boost::ref(op), resource, options, Pathname());
367 provide( boost::ref(op), resource, options, Pathname());
399 WAR <<
"Verifier not found" << endl;
409 if (scheme ==
"cd" || scheme ==
"dvd")
412 DBG <<
"Rewriting url " << url_r << endl;
428 DBG <<
"Url rewrite result: " << url << endl;
442 DBG <<
"Url rewrite result: " << url << endl;
451 DBG <<
"Releasing all media IDs held by this MediaSetAccess" << endl;
453 for (MediaMap::const_iterator m =
_medias.begin(); m !=
_medias.end(); ++m)
454 manager.
release(m->second,
"");
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.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
String related utilities and Regular expression matching.
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::list< DirEntry > DirContent
Returned by readdir.
void operator()(media::MediaAccessId media, const Pathname &file)
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
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)
Wrapper for const correct access via Smart pointer types.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
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)
std::string getScheme() const
Returns the scheme name of the URL.
Easy-to use interface to the ZYPP dependency resolver.
#define IMPL_PTR_TYPE(NAME)