15#include <solv/solvable.h>
16#include <solv/poolarch.h>
17#include <solv/repo_solv.h>
18#include <solv/repo_rpmdb.h>
19#include <solv/pool_fileconflicts.h>
22#include <unordered_set>
28#include <zypp-core/base/UserRequestException>
51 struct FileConflictsCB
55 ,
_state( ::rpm_state_create( pool_r, ::pool_get_rootdir(pool_r) ), ::rpm_state_free )
60 void * ret = lookup( id_r );
68 if ( ! ret && sat::Solvable( id_r ).isKind<Package>() )
79 const sat::Queue & noFilelist()
const
83 {
return (*
reinterpret_cast<FileConflictsCB*
>(cbdata_r))( pool_r, id_r ); }
88 sat::Solvable solv( id_r );
89 if ( solv.isSystem() )
91 Solvable * s = solv.get();
92 if ( ! s->repo->rpmdbid )
97 return ::rpm_byrpmdbid( _state, rpmdbid );
104 Pathname localfile( pkg->cachedLocation() );
105 if ( localfile.empty() )
107 AutoDispose<FILE*> fp( ::fopen( localfile.c_str(),
"re" ), ::fclose );
108 return ::rpm_byfp( _state, fp, localfile.c_str() );
127 MIL <<
"Checking for file conflicts in " <<
newpkgs <<
" new packages..." << endl;
134 if ( ! report->start( progress ) )
140 if ( ! report->progress(
progress_r,
cb.noFilelist() ) )
155 &FileConflictsCB::invoke,
161 if ( ! report->result( progress,
cb.noFilelist(), conflicts ) )
std::unordered_set< sat::detail::IdType > _visited
AutoDispose< void * > _state
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Maintain [min,max] and counter (value) for progress counting.
void sendTo(const ReceiverFnc &fnc_r)
Set ReceiverFnc.
bool toMax()
Set counter value to current max value (unless no range).
void noSend()
Set no ReceiverFnc.
Options and policies for ZYpp::commit.
Result returned from ZYpp::commit.
Libsolv queue representing file conflicts.
static Pool instance()
Singleton ctor.
Libsolv Id queue wrapper.
void commitFindFileConflicts(const ZYppCommitPolicy &policy_r, ZYppCommitResult &result_r)
Commit helper checking for file conflicts after download.
std::enable_if< std::is_member_pointer< typenamestd::decay< Functor >::type >::value, typenamestd::result_of< Functor &&(Args &&...)>::type >::typ invoke)(Functor &&f, Args &&... args)
int IdType
Generic Id type.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Easy-to use interface to the ZYPP dependency resolver.
ProgressObserverRef _progress
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.