ZYPP_THROW( Exception("Can't copy " + tmp_file.asString() + " to " + dest_dir.asString()));
}
-
+ media.releaseFile((*it_res)->location); //not needed anymore, only eat space
}
catch (Exception & excpt_r)
{
// report->finish( file_url, source::DownloadFileReport::NO_ERROR, "" );
// return file;
+ void MediaSetAccess::releaseFile( const OnMediaLocation & on_media_file )
+ {
+ releaseFile( on_media_file.filename(), on_media_file.medianr() );
+ }
+
+ void MediaSetAccess::releaseFile( const Pathname & file, unsigned media_nr)
+ {
+ media::MediaManager media_mgr;
+ media::MediaAccessId media;
+
+ media = getMediaAccessId( media_nr);
+ DBG << "Going to release file " << file
+ << " from media number " << media_nr << endl;
+
+ if ( ! media_mgr.isAttached(media) )
+ return; //disattached media is free
+
+ media_mgr.releaseFile (media, file);
+ }
Pathname MediaSetAccess::provideFile( const OnMediaLocation & on_media_file )
{
Pathname provideFile(const Pathname & file, unsigned media_nr = 1 );
/**
+ * Release file from media.
+ * This signal that file is not needed anymore.
+ *
+ * \param on_media_file location of the file on media
+ */
+ void releaseFile( const OnMediaLocation & on_media_file );
+
+
+ /**
+ * Release file from media.
+ * This signal that file is not needed anymore.
+ *
+ * \param file path to the file relative to media URL
+ * \param media_nr the media number in the media set
+ */
+ void releaseFile(const Pathname & file, unsigned media_nr = 1 );
+
+ /**
* Provides direcotry \a dir from media number \a media_nr.
*
* \param dir path to the directory relative to media URL