214
227
bool Pool::isRequestedLocale( const Locale & locale_r ) const
215
228
{ return myPool().isRequestedLocale( locale_r ); }
230
void Pool::initRequestedLocales( const LocaleSet & locales_r ) { myPool().initRequestedLocales( locales_r ); }
231
const LocaleSet & Pool::getAddedRequestedLocales() const { return myPool().getAddedRequestedLocales(); }
232
const LocaleSet & Pool::getRemovedRequestedLocales() const { return myPool().getRemovedRequestedLocales(); }
217
234
const LocaleSet & Pool::getAvailableLocales() const
218
235
{ return myPool().getAvailableLocales(); }
220
237
bool Pool::isAvailableLocale( const Locale & locale_r ) const
221
238
{ return myPool().isAvailableLocale( locale_r ); }
223
bool Pool::multiversionEmpty() const { return myPool().multiversionList().empty(); }
224
size_t Pool::multiversionSize() const { return myPool().multiversionList().size(); }
225
Pool::MultiversionIterator Pool::multiversionBegin() const { return myPool().multiversionList().begin(); }
226
Pool::MultiversionIterator Pool::multiversionEnd() const { return myPool().multiversionList().end(); }
227
bool Pool::isMultiversion( IdString ident_r ) const { return myPool().isMultiversion( ident_r ); }
240
const Pool::MultiversionList & Pool::multiversion() const
241
{ return myPool().multiversionList(); }
229
243
Queue Pool::autoInstalled() const { return myPool().autoInstalled(); }
230
244
void Pool::setAutoInstalled( const Queue & autoInstalled_r ){ myPool().setAutoInstalled( autoInstalled_r ); }
245
259
/////////////////////////////////////////////////////////////////
260
#undef ZYPP_BASE_LOGGER_LOGGROUP
261
#define ZYPP_BASE_LOGGER_LOGGROUP "solvidx"
263
void updateSolvFileIndex( const Pathname & solvfile_r )
265
AutoDispose<FILE*> solv( ::fopen( solvfile_r.c_str(), "re" ), ::fclose );
269
ERR << "Can't open solv-file: " << solv << endl;
273
std::string solvidxfile( solvfile_r.extend(".idx").asString() );
274
if ( ::unlink( solvidxfile.c_str() ) == -1 && errno != ENOENT )
276
ERR << "Can't unlink solv-idx: " << Errno() << endl;
280
int fd = ::open( solvidxfile.c_str(), O_CREAT|O_EXCL|O_WRONLY|O_TRUNC, 0644 );
283
ERR << "Can't create solv-idx: " << Errno() << endl;
288
std::ofstream idx( solvidxfile.c_str() );
291
::_Pool * _pool = ::pool_create();
292
::_Repo * _repo = ::repo_create( _pool, "" );
293
if ( ::repo_add_solv( _repo, solv, 0 ) == 0 )
296
::_Solvable * _solv = nullptr;
297
FOR_REPO_SOLVABLES( _repo, _id, _solv )
302
#define idstr(V) pool_id2str( _pool, _solv->V )
303
if ( _solv->arch == ARCH_SRC || _solv->arch == ARCH_NOSRC )
304
idx << "srcpackage:" << idstr(name) << SEP << idstr(evr) << SEP << "noarch" << endl;
306
idx << idstr(name) << SEP << idstr(evr) << SEP << idstr(arch) << endl;
312
ERR << "Can't read solv-file: " << ::pool_errstr( _pool ) << endl;
314
::repo_free( _repo, 0 );
315
::pool_free( _pool );
318
/////////////////////////////////////////////////////////////////
246
319
} // namespace sat
247
320
///////////////////////////////////////////////////////////////////
248
321
/////////////////////////////////////////////////////////////////