#include <zypp/KeyRing.h>
#include <zypp/Date.h>
#include <zypp/SourceManager.h>
+#include <zypp/ManagedFile.h>
using namespace std;
using namespace zypp;
#define LOG (debug ? USR : cout)
+#include <zypp/ManagedFile.h>
+#include "zypp/source/PackageProvider.h"
+
+ static void sourceProvidePackage( const ResObject::Ptr & pi )
+ {
+ // Redirect PackageProvider queries for installed editions
+ // (in case of patch/delta rpm processing) to rpmDb.
+ source::PackageProviderPolicy packageProviderPolicy;
+ //packageProviderPolicy.queryInstalledCB( QueryInstalledEditionHelper() );
+
+ Package::constPtr p = asKind<Package>(pi);
+ if ( p )
+ {
+ source::PackageProvider pkgProvider( p, packageProviderPolicy );
+ SEC << "++++" << endl;
+ ManagedFile r( pkgProvider.providePackage() );
+ SEC << "---" << endl;
+ }
+ SEC << "-" << endl;
+ }
+
struct KeyRingReceiver : public callback::ReceiveReport<KeyRingReport>
{
KeyRingReceiver()
}
LOG << for_each( src.resolvables().begin(), src.resolvables().end(),
ResStoreStats() ) << endl;
+
+ for_each( src.resolvables().begin(),
+ src.resolvables().end(),
+ sourceProvidePackage );
+
if ( verbose )
{
dumpRange( LOG, src.resolvables().begin(), src.resolvables().end() ) << endl;
//
// FIXME: use mkdtemp?
//
+#warning Use class TmpDir from TmpPath.h
Pathname abase( attach_root + "AP_" );
// ma and sh need more than 42 for debugging :-)
// since the readonly fs are handled now, ...
function<bool ( int )> _redirect;
};
+ /** ManagedFile Dispose functor.
+ * The Pathname argument is ignored, as Source_Ref::releaseFile expects the filename
+ * relative to the medias root (i.e. same args as to provideFile).
+ */
+ struct SourceReleaseFile
+ {
+ SourceReleaseFile( Source_Ref source_r, const Pathname & location_r, unsigned mediaNr_r )
+ : _source( source_r ), _location( location_r ), _medianr( mediaNr_r )
+ {}
+
+ void operator()( const Pathname & /*UNUSED*/ )
+ {
+ _source.releaseFile( _location, _medianr );
+ }
+
+ Source_Ref _source;
+ Pathname _location;
+ unsigned _medianr;
+ };
+
/////////////////////////////////////////////////////////////////
} // namespace
///////////////////////////////////////////////////////////////////
ManagedFile ret( source_r.provideFile( loc_r.filename(), loc_r.medianr() ),
- bind( &Source_Ref::releaseFile, source_r, _1, loc_r.medianr() ) );
+ SourceReleaseFile( source_r, loc_r.filename(), loc_r.medianr() ) );
if ( loc_r.checksum().empty() )
{