13 #include <solv/pool.h>
14 #include <solv/repo.h>
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>
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 ) )
139 auto sendProgress = [&](
const ProgressData & progress_r )->
bool {
140 if ( !
report->progress( progress_r, cb.noFilelist() ) )
147 progress.
sendTo( sendProgress );
154 FINDFILECONFLICTS_USE_SOLVABLEFILELIST | FINDFILECONFLICTS_CHECK_DIRALIASING | FINDFILECONFLICTS_USE_ROOTDIR,
155 &FileConflictsCB::invoke,
160 (count?
WAR:
MIL) <<
"Found " << count <<
" file conflicts." << endl;
161 if ( !
report->result( progress, cb.noFilelist(), conflicts ) )
164 catch (
const AbortRequestException & e )