12 #include <sys/types.h>
18 #include <solv/pool.h>
19 #include <solv/repo.h>
20 #include <solv/solvable.h>
53 {
return myPool()->nsolvables; }
71 {
return !
myPool()->urepos; }
74 {
return myPool()->urepos; }
97 if ( ! it->solvablesEmpty() )
111 ret += it->solvablesSize();
146 if ( alias_r == it->alias() )
169 tmprepo->addSolv( file_r );
177 {
return addRepoSolv( file_r, file_r.basename() ); }
193 tmprepo->addHelix( file_r );
255 return str <<
"sat::pool(" << obj.
serial() <<
")["
262 #undef ZYPP_BASE_LOGGER_LOGGROUP
263 #define ZYPP_BASE_LOGGER_LOGGROUP "solvidx"
271 ERR <<
"Can't open solv-file: " << solv << endl;
275 std::string solvidxfile( solvfile_r.extend(
".idx").asString() );
276 if ( ::
unlink( solvidxfile.c_str() ) == -1 && errno != ENOENT )
278 ERR <<
"Can't unlink solv-idx: " <<
Errno() << endl;
282 int fd = ::open( solvidxfile.c_str(), O_CREAT|O_EXCL|O_WRONLY|O_TRUNC, 0644 );
285 ERR <<
"Can't create solv-idx: " <<
Errno() << endl;
290 std::ofstream idx( solvidxfile.c_str() );
295 if ( ::repo_add_solv( _repo, solv, 0 ) == 0 )
299 FOR_REPO_SOLVABLES( _repo, _id, _solv )
304 #define idstr(V) pool_id2str( _pool, _solv->V )
305 if ( _solv->arch == ARCH_SRC || _solv->arch == ARCH_NOSRC )
306 idx <<
"srcpackage:" <<
idstr(name) <<
SEP <<
idstr(evr) <<
SEP <<
"noarch" << endl;
314 ERR <<
"Can't read solv-file: " << ::pool_errstr( _pool ) << endl;
316 ::repo_free( _repo, 0 );
317 ::pool_free( _pool );