+-------------------------------------------------------------------
+Thu Apr 6 16:37:49 CEST 2006 - jsrain@suse.de
+
+- fixed setting autorefresh flag for installation sources
+
-------------------------------------------------------------------
Thu Apr 6 15:53:02 CEST 2006 - kkaempf@suse.de
return (scheme == "ftp" || scheme == "http" || scheme == "https");
}
+// STATIC
+bool
+MediaAccess::canBeVolatile(const Url &url)
+{
+ std::string scheme( url.getScheme());
+ return ! (scheme == "cd" || scheme == "dvd");
+}
+
// Type of media if open, otherwise NONE.
std::string
MediaAccess::protocol() const
*/
static
bool downloads(const Url &url);
+ /**
+ * Hint whether the media can provide volatile contents
+ *
+ * @note This hint is based on the \p url scheme
+ * only and does not imply, that the URL is valid.
+ *
+ * @param url The media URL to check.
+ * @return True, if the files are downloaded.
+ */
+ static
+ bool canBeVolatile(const Url &url);
/**
* Used Protocol if media is opened, otherwise 'unknown'.
_cache_dir = cache_dir_r;
_subscribed = true;
- // for remote sources we enable autorefresh by default
- _autorefresh = media::MediaAccess::downloads( _url );
+ // for sources which are neither CD nor DVD we enable autorefresh by default
+ _autorefresh = media::MediaAccess::canBeVolatile( _url );
try
{
}
std::string buffer;
+ volatile_content = false;
while(file && !file.eof())
{
getline(file, buffer);
parseFileCheckSum( key, value, prodImpl->_descr_files_checksums);
else if(key == "KEY")
parseFileCheckSum( key, value, prodImpl->_signing_keys);
+ else if(key == "VOLATILE_CONTENT")
+ volatile_content = true;
else
DBG << "Unknown key [" << key << "] with value [" << value << "]" << std::endl;
}
*/
void parseFileCheckSum( const std::string &key, const std::string &value, std::map<std::string, CheckSum> &container);
+
+ bool volatile_content;
+
};
///////////////////////////////////////////////////////////////////
MIL << "Product: " << product->summary() << endl;
store.insert( product );
_prodImpl = p.prodImpl;
+ _autorefresh = p.volatile_content && media::MediaAccess::canBeVolatile( _url );
}
catch (Exception & excpt_r) {
ERR << "cannot parse content file" << endl;