libzypp  14.29.1
PoolImpl.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 #include <fstream>
14 #include <boost/mpl/int.hpp>
15 
16 #include "zypp/base/Easy.h"
17 #include "zypp/base/LogTools.h"
18 #include "zypp/base/Gettext.h"
19 #include "zypp/base/Exception.h"
20 #include "zypp/base/Measure.h"
21 #include "zypp/base/WatchFile.h"
22 #include "zypp/base/Sysconfig.h"
23 #include "zypp/base/IOStream.h"
24 
25 #include "zypp/ZConfig.h"
26 
28 #include "zypp/sat/Pool.h"
29 #include "zypp/Capability.h"
30 #include "zypp/Locale.h"
31 #include "zypp/PoolItem.h"
32 
35 
36 extern "C"
37 {
38 // Workaround libsolv project not providing a common include
39 // directory. (the -devel package does, but the git repo doesn't).
40 // #include <solv/repo_helix.h>
41 int repo_add_helix( ::Repo *repo, FILE *fp, int flags );
42 }
43 
44 using std::endl;
45 
46 #undef ZYPP_BASE_LOGGER_LOGGROUP
47 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::satpool"
48 
49 // ///////////////////////////////////////////////////////////////////
50 namespace zypp
51 {
53  namespace env
54  {
56  inline int LIBSOLV_DEBUGMASK()
57  {
58  const char * envp = getenv("LIBSOLV_DEBUGMASK");
59  return envp ? str::strtonum<int>( envp ) : 0;
60  }
61  } // namespace env
63  namespace sat
64  {
65 
67  namespace detail
68  {
69 
70  // MPL checks for satlib constants we redefine to avoid
71  // includes and defines.
72  BOOST_MPL_ASSERT_RELATION( noId, ==, STRID_NULL );
73  BOOST_MPL_ASSERT_RELATION( emptyId, ==, STRID_EMPTY );
74 
76  BOOST_MPL_ASSERT_RELATION( systemSolvableId, ==, SYSTEMSOLVABLE );
77 
78  BOOST_MPL_ASSERT_RELATION( solvablePrereqMarker, ==, SOLVABLE_PREREQMARKER );
79  BOOST_MPL_ASSERT_RELATION( solvableFileMarker, ==, SOLVABLE_FILEMARKER );
80 
86 
88 
89  const std::string & PoolImpl::systemRepoAlias()
90  {
91  static const std::string _val( "@System" );
92  return _val;
93  }
94 
95  const Pathname & sysconfigStoragePath()
96  {
97  static const Pathname _val( "/etc/sysconfig/storage" );
98  return _val;
99  }
100 
101 
103 
104  static void logSat( struct _Pool *, void *data, int type, const char *logString )
105  {
106  if ( type & (SOLV_FATAL|SOLV_ERROR) ) {
107  _ERR("libsolv") << logString;
108  } else if ( type & SOLV_DEBUG_STATS ) {
109  _DBG("libsolv") << logString;
110  } else {
111  _MIL("libsolv") << logString;
112  }
113  }
114 
115  detail::IdType PoolImpl::nsCallback( struct _Pool *, void * data, detail::IdType lhs, detail::IdType rhs )
116  {
117  // lhs: the namespace identifier, e.g. NAMESPACE:MODALIAS
118  // rhs: the value, e.g. pci:v0000104Cd0000840[01]sv*sd*bc*sc*i*
119  // return: 0 if not supportded
120  // 1 if supported by the system
121  // -1 AFAIK it's also possible to return a list of solvables that support it, but don't know how.
122 
123  static const detail::IdType RET_unsupported = 0;
124  static const detail::IdType RET_systemProperty = 1;
125  switch ( lhs )
126  {
127  case NAMESPACE_LANGUAGE:
128  {
129  static IdString en( "en" );
130  const std::tr1::unordered_set<IdString> & locale2Solver( reinterpret_cast<PoolImpl*>(data)->_locale2Solver );
131  if ( locale2Solver.empty() )
132  {
133  return rhs == en.id() ? RET_systemProperty : RET_unsupported;
134  }
135  return locale2Solver.find( IdString(rhs) ) != locale2Solver.end() ? RET_systemProperty : RET_unsupported;
136  }
137  break;
138 
139  case NAMESPACE_MODALIAS:
140  {
141  // modalias strings in capability may be hexencoded because rpm does not allow
142  // ',', ' ' or other special chars.
143  return target::Modalias::instance().query( str::hexdecode( IdString(rhs).c_str() ) )
144  ? RET_systemProperty
145  : RET_unsupported;
146  }
147  break;
148 
149  case NAMESPACE_FILESYSTEM:
150  {
151  const std::set<std::string> & requiredFilesystems( reinterpret_cast<PoolImpl*>(data)->requiredFilesystems() );
152  return requiredFilesystems.find( IdString(rhs).asString() ) != requiredFilesystems.end() ? RET_systemProperty : RET_unsupported;
153  }
154  break;
155 
156  }
157 
158  WAR << "Unhandled " << Capability( lhs ) << " vs. " << Capability( rhs ) << endl;
159  return RET_unsupported;
160  }
161 
163  //
164  // METHOD NAME : PoolMember::myPool
165  // METHOD TYPE : PoolImpl
166  //
168  {
169  static PoolImpl _global;
170  return _global;
171  }
172 
174  //
175  // METHOD NAME : PoolImpl::PoolImpl
176  // METHOD TYPE : Ctor
177  //
179  : _pool( ::pool_create() )
180  {
181  MIL << "Creating sat-pool." << endl;
182  if ( ! _pool )
183  {
184  ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
185  }
186  // initialialize logging
187  if ( env::LIBSOLV_DEBUGMASK() )
188  {
189  ::pool_setdebugmask(_pool, env::LIBSOLV_DEBUGMASK() );
190  }
191  else
192  {
193  if ( getenv("ZYPP_LIBSOLV_FULLLOG") || getenv("ZYPP_LIBSAT_FULLLOG") )
194  ::pool_setdebuglevel( _pool, 3 );
195  else if ( getenv("ZYPP_FULLLOG") )
196  ::pool_setdebuglevel( _pool, 2 );
197  else
198  ::pool_setdebugmask(_pool, SOLV_DEBUG_JOB|SOLV_DEBUG_STATS );
199  }
200 
201  ::pool_setdebugcallback( _pool, logSat, NULL );
202 
203  // set namespace callback
204  _pool->nscallback = &nsCallback;
205  _pool->nscallbackdata = (void*)this;
206  }
207 
209  //
210  // METHOD NAME : PoolImpl::~PoolImpl
211  // METHOD TYPE : Dtor
212  //
214  {
215  ::pool_free( _pool );
216  }
217 
219 
220  void PoolImpl::setDirty( const char * a1, const char * a2, const char * a3 )
221  {
222  if ( a1 )
223  {
224  if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl;
225  else if ( a2 ) MIL << a1 << " " << a2 << endl;
226  else MIL << a1 << endl;
227  }
228  _serial.setDirty(); // pool content change
229  _availableLocalesPtr.reset(); // available locales may change
230  _multiversionListPtr.reset(); // re-evaluate ZConfig::multiversionSpec.
231 
232  // invaldate dependency/namespace related indices:
233  depSetDirty();
234  }
235 
236  void PoolImpl::depSetDirty( const char * a1, const char * a2, const char * a3 )
237  {
238  if ( a1 )
239  {
240  if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl;
241  else if ( a2 ) MIL << a1 << " " << a2 << endl;
242  else MIL << a1 << endl;
243  }
244  ::pool_freewhatprovides( _pool );
245  }
246 
247  void PoolImpl::prepare() const
248  {
249  if ( _watcher.remember( _serial ) )
250  {
251  // After repo/solvable add/remove:
252  // set pool architecture
253  ::pool_setarch( _pool, ZConfig::instance().systemArchitecture().asString().c_str() );
254  }
255  if ( ! _pool->whatprovides )
256  {
257  MIL << "pool_createwhatprovides..." << endl;
258 
259  ::pool_addfileprovides( _pool );
260  ::pool_createwhatprovides( _pool );
261  }
262  if ( ! _pool->languages )
263  {
264  // initial seting
265  const_cast<PoolImpl*>(this)->setTextLocale( ZConfig::instance().textLocale() );
266  }
267  }
268 
270  {
271  // additional /etc/sysconfig/storage check:
272  static WatchFile sysconfigFile( sysconfigStoragePath(), WatchFile::NO_INIT );
273  if ( sysconfigFile.hasChanged() )
274  {
275  _requiredFilesystemsPtr.reset(); // recreated on demand
276  const_cast<PoolImpl*>(this)->depSetDirty( "/etc/sysconfig/storage change" );
277  }
278  // finally prepare as usual:
279  prepare();
280  }
281 
283 
284  ::_Repo * PoolImpl::_createRepo( const std::string & name_r )
285  {
286  setDirty(__FUNCTION__, name_r.c_str() );
287  ::_Repo * ret = ::repo_create( _pool, name_r.c_str() );
288  if ( ret && name_r == systemRepoAlias() )
289  ::pool_set_installed( _pool, ret );
290  return ret;
291  }
292 
293  void PoolImpl::_deleteRepo( ::_Repo * repo_r )
294  {
295  setDirty(__FUNCTION__, repo_r->name );
296  if ( isSystemRepo( repo_r ) )
298  eraseRepoInfo( repo_r );
299  ::repo_free( repo_r, /*reuseids*/false );
300  }
301 
302  int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r )
303  {
304  setDirty(__FUNCTION__, repo_r->name );
305  int ret = ::repo_add_solv( repo_r, file_r, 0 );
306  if ( ret == 0 )
307  _postRepoAdd( repo_r );
308  return ret;
309  }
310 
311  int PoolImpl::_addHelix( ::_Repo * repo_r, FILE * file_r )
312  {
313  setDirty(__FUNCTION__, repo_r->name );
314  int ret = ::repo_add_helix( repo_r, file_r, 0 );
315  if ( ret == 0 )
316  _postRepoAdd( repo_r );
317  return 0;
318  }
319 
320  void PoolImpl::_postRepoAdd( ::_Repo * repo_r )
321  {
322  if ( ! isSystemRepo( repo_r ) )
323  {
324  // Filter out unwanted archs
325  std::set<detail::IdType> sysids;
326  {
327  Arch::CompatSet sysarchs( Arch::compatSet( ZConfig::instance().systemArchitecture() ) );
328  for_( it, sysarchs.begin(), sysarchs.end() )
329  sysids.insert( it->id() );
330 
331  // unfortunately libsolv treats src/nosrc as architecture:
332  sysids.insert( ARCH_SRC );
333  sysids.insert( ARCH_NOSRC );
334  }
335 
336  detail::IdType blockBegin = 0;
337  unsigned blockSize = 0;
338  for ( detail::IdType i = repo_r->start; i < repo_r->end; ++i )
339  {
340  ::_Solvable * s( _pool->solvables + i );
341  if ( s->repo == repo_r && sysids.find( s->arch ) == sysids.end() )
342  {
343  // Remember an unwanted arch entry:
344  if ( ! blockBegin )
345  blockBegin = i;
346  ++blockSize;
347  }
348  else if ( blockSize )
349  {
350  // Free remembered entries
351  ::repo_free_solvable_block( repo_r, blockBegin, blockSize, /*reuseids*/false );
352  blockBegin = blockSize = 0;
353  }
354  }
355  if ( blockSize )
356  {
357  // Free remembered entries
358  ::repo_free_solvable_block( repo_r, blockBegin, blockSize, /*reuseids*/false );
359  blockBegin = blockSize = 0;
360  }
361  }
362  }
363 
364  detail::SolvableIdType PoolImpl::_addSolvables( ::_Repo * repo_r, unsigned count_r )
365  {
366  setDirty(__FUNCTION__, repo_r->name );
367  return ::repo_add_solvable_block( repo_r, count_r );
368  }
369 
370  void PoolImpl::setRepoInfo( RepoIdType id_r, const RepoInfo & info_r )
371  {
372  ::_Repo * repo( getRepo( id_r ) );
373  if ( repo )
374  {
375  bool dirty = false;
376 
377  // libsolv priority is based on '<', while yum's repoinfo
378  // uses 1(highest)->99(lowest). Thus we use -info_r.priority.
379  if ( repo->priority != int(-info_r.priority()) )
380  {
381  repo->priority = -info_r.priority();
382  dirty = true;
383  }
384 
385  // subpriority is used to e.g. prefer http over dvd iff
386  // both have same priority.
387  int mediaPriority( media::MediaPriority( info_r.url() ) );
388  if ( repo->subpriority != mediaPriority )
389  {
390  repo->subpriority = mediaPriority;
391  dirty = true;
392  }
393 
394  if ( dirty )
395  setDirty(__FUNCTION__, info_r.alias().c_str() );
396  }
397  _repoinfos[id_r] = info_r;
398  }
399 
401 
402  // need on demand and id based Locale
403  void _locale_hack( const LocaleSet & locales_r,
404  std::tr1::unordered_set<IdString> & locale2Solver )
405  {
406  std::tr1::unordered_set<IdString>( 2*locales_r.size() ).swap( locale2Solver );
407  for_( it, locales_r.begin(),locales_r.end() )
408  {
409  for ( Locale l( *it ); l != Locale::noCode; l = l.fallback() )
410  locale2Solver.insert( IdString( l.code() ) );
411  }
412  MIL << "New Solver Locales: " << locale2Solver << endl;
413  }
414 
415  void PoolImpl::setTextLocale( const Locale & locale_r )
416  {
417  std::vector<std::string> fallbacklist;
418  for ( Locale l( locale_r ); l != Locale::noCode; l = l.fallback() )
419  {
420  fallbacklist.push_back( l.code() );
421  }
422  dumpRangeLine( MIL << "pool_set_languages: ", fallbacklist.begin(), fallbacklist.end() ) << endl;
423 
424  std::vector<const char *> fallbacklist_cstr;
425  for_( it, fallbacklist.begin(), fallbacklist.end() )
426  {
427  fallbacklist_cstr.push_back( it->c_str() );
428  }
429  ::pool_set_languages( _pool, &fallbacklist_cstr.front(), fallbacklist_cstr.size() );
430  }
431 
432  void PoolImpl::setRequestedLocales( const LocaleSet & locales_r )
433  {
434  depSetDirty( "setRequestedLocales" );
435  _requestedLocales = locales_r;
436  MIL << "New RequestedLocales: " << locales_r << endl;
438  }
439 
440  bool PoolImpl::addRequestedLocale( const Locale & locale_r )
441  {
442  if ( _requestedLocales.insert( locale_r ).second )
443  {
444  depSetDirty( "addRequestedLocale", locale_r.code().c_str() );
446  return true;
447  }
448  return false;
449  }
450 
451  bool PoolImpl::eraseRequestedLocale( const Locale & locale_r )
452  {
453  if ( _requestedLocales.erase( locale_r ) )
454  {
455  depSetDirty( "addRequestedLocale", locale_r.code().c_str() );
457  return true;
458  }
459  return false;
460  }
461 
462  static void _getLocaleDeps( Capability cap_r, std::tr1::unordered_set<sat::detail::IdType> & store_r )
463  {
464  // Collect locales from any 'namespace:language(lang)' dependency
465  CapDetail detail( cap_r );
466  if ( detail.kind() == CapDetail::EXPRESSION )
467  {
468  switch ( detail.capRel() )
469  {
470  case CapDetail::CAP_AND:
471  case CapDetail::CAP_OR:
472  // expand
473  _getLocaleDeps( detail.lhs(), store_r );
474  _getLocaleDeps( detail.rhs(), store_r );
475  break;
476 
478  if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
479  {
480  store_r.insert( detail.rhs().id() );
481  }
482  break;
483 
484  case CapDetail::REL_NONE:
485  case CapDetail::CAP_WITH:
486  case CapDetail::CAP_ARCH:
487  break; // unwanted
488  }
489  }
490  }
491 
493  {
494  if ( !_availableLocalesPtr )
495  {
496  // Collect any 'namespace:language(ja)' dependencies
497  std::tr1::unordered_set<sat::detail::IdType> tmp;
498  Pool pool( Pool::instance() );
499  for_( it, pool.solvablesBegin(), pool.solvablesEnd() )
500  {
501  Capabilities cap( it->supplements() );
502  for_( cit, cap.begin(), cap.end() )
503  {
504  _getLocaleDeps( *cit, tmp );
505  }
506  }
507 #warning immediately build LocaleSet as soon as Loale is an Id based type
508  _availableLocalesPtr.reset( new LocaleSet(tmp.size()) );
509  for_( it, tmp.begin(), tmp.end() )
510  {
511  _availableLocalesPtr->insert( Locale( IdString(*it) ) );
512  }
513  }
514  return *_availableLocalesPtr;
515  }
516 
518  {
521 
522  const std::set<std::string> & multiversionSpec( ZConfig::instance().multiversionSpec() );
523  for_( it, multiversionSpec.begin(), multiversionSpec.end() )
524  {
525  static const std::string prefix( "provides:" );
526  if ( str::hasPrefix( *it, prefix ) )
527  {
528  WhatProvides provides( Capability( it->c_str() + prefix.size() ) );
529  if ( provides.empty() )
530  {
531  MIL << "Multiversion install not provided (" << *it << ")" << endl;
532  }
533  else
534  {
535  for_( pit, provides.begin(), provides.end() )
536  {
537  if ( multiversionList.insert( pit->ident() ).second )
538  MIL << "Multiversion install " << pit->ident() << " (" << *it << ")" << endl;
539  }
540  }
541  }
542  else
543  {
544  MIL << "Multiversion install " << *it << endl;
545  multiversionList.insert( IdString( *it ) );
546  }
547  }
548  }
549 
550  const std::set<std::string> & PoolImpl::requiredFilesystems() const
551  {
552  if ( ! _requiredFilesystemsPtr )
553  {
554  _requiredFilesystemsPtr.reset( new std::set<std::string> );
555  std::set<std::string> & requiredFilesystems( *_requiredFilesystemsPtr );
557  std::inserter( requiredFilesystems, requiredFilesystems.end() ) );
558  }
559  return *_requiredFilesystemsPtr;
560  }
561 
563  } // namespace detail
566  } // namespace sat
569 } // namespace zypp
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
static const Locale noCode
No or empty code.
Definition: Locale.h:71
Interface to gettext.
#define MIL
Definition: Logger.h:47
const Pathname & sysconfigStoragePath()
Definition: PoolImpl.cc:95
bool isSystemRepo(::_Repo *repo_r) const
Definition: PoolImpl.h:91
int IdType
Generic Id type.
Definition: PoolMember.h:82
std::string alias() const
unique identifier for this source.
Container of Solvable providing a Capability (read only).
Definition: WhatProvides.h:87
bool eraseRequestedLocale(const Locale &locale_r)
Definition: PoolImpl.cc:451
scoped_ptr< LocaleSet > _availableLocalesPtr
Definition: PoolImpl.h:279
Container of Capability (currently read only).
Definition: Capabilities.h:35
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition: Exception.h:320
static ZConfig & instance()
Singleton ctor.
Definition: ZConfig.cc:655
::_Repo * _createRepo(const std::string &name_r)
Creating a new repo named name_r.
Definition: PoolImpl.cc:284
CapRel capRel() const
Definition: Capability.h:344
Helper providing more detailed information about a Capability.
Definition: Capability.h:289
unsigned split(const C_Str &line_r, _OutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
Definition: String.h:463
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition: Modalias.h:69
bool empty() const
Whether the container is empty.
SolvableIterator solvablesEnd() const
Iterator behind the last Solvable.
Definition: Pool.cc:100
IdType id() const
Expert backdoor.
Definition: IdString.h:103
bool addRequestedLocale(const Locale &locale_r)
Definition: PoolImpl.cc:440
void setDirty(const char *a1=0, const char *a2=0, const char *a3=0)
Invalidate housekeeping data (e.g.
Definition: PoolImpl.cc:220
void prepareForSolving() const
prepare plus some expensive checks done before solving only.
Definition: PoolImpl.cc:269
::_Repo * RepoIdType
Id type to connect Repo and sat-repo.
Definition: PoolMember.h:106
#define _MIL(GROUP)
Definition: Logger.h:56
bool hasChanged()
Definition: WatchFile.h:68
std::set< Arch, CompareByGT< Arch > > CompatSet
Reversed arch order, best Arch first.
Definition: Arch.h:117
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition: PoolMember.h:98
void eraseRepoInfo(RepoIdType id_r)
Definition: PoolImpl.h:186
What is known about a repository.
Definition: RepoInfo.h:66
const std::set< std::string > & requiredFilesystems() const
accessor for etc/sysconfig/storage reading file on demand
Definition: PoolImpl.cc:550
Access to the sat-pools string space.
Definition: IdString.h:39
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:27
static const IdType solvableFileMarker(16)
map< string, string > read(const Pathname &_path)
Read sysconfig file path_r and return (key,valye) pairs.
Definition: Sysconfig.cc:34
void _deleteRepo(::_Repo *repo_r)
Creating a new repo named name_r.
Definition: PoolImpl.cc:293
unsigned priority() const
Repository priority for solver.
Definition: RepoInfo.cc:213
Remember a files attributes to detect content changes.
Definition: WatchFile.h:49
static void _getLocaleDeps(Capability cap_r, std::tr1::unordered_set< sat::detail::IdType > &store_r)
Definition: PoolImpl.cc:462
Capability lhs() const
Definition: Capability.h:343
void multiversionListInit() const
Definition: PoolImpl.cc:517
const LocaleSet & getAvailableLocales() const
Definition: PoolImpl.cc:492
int _addSolv(::_Repo *repo_r, FILE *file_r)
Adding solv file to a repo.
Definition: PoolImpl.cc:302
int repo_add_helix(::Repo *repo, FILE *fp, int flags)
PoolImpl()
Default ctor.
Definition: PoolImpl.cc:178
detail::SolvableIdType _addSolvables(::_Repo *repo_r, unsigned count_r)
Adding Solvables to a repo.
Definition: PoolImpl.cc:364
void _locale_hack(const LocaleSet &locales_r, std::tr1::unordered_set< IdString > &locale2Solver)
Definition: PoolImpl.cc:403
static Pool instance()
Singleton ctor.
Definition: Pool.h:52
Locale fallback() const
Return a fallback locale for this locale, when giving up, returns empty Locale()
Definition: Locale.cc:223
static const IdType emptyId(1)
const_iterator begin() const
Iterator pointing to the first Solvable.
void setRepoInfo(RepoIdType id_r, const RepoInfo &info_r)
Also adjust repo priority and subpriority accordingly.
Definition: PoolImpl.cc:370
#define _ERR(GROUP)
Definition: Logger.h:58
const_iterator end() const
Iterator pointing behind the last Solvable.
Definition: WhatProvides.h:226
Kind kind() const
Definition: Capability.h:325
SerialNumberWatcher _watcher
Watch serial number.
Definition: PoolImpl.h:273
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
void setRequestedLocales(const LocaleSet &locales_r)
Definition: PoolImpl.cc:432
#define WAR
Definition: Logger.h:48
static void logSat(struct _Pool *, void *data, int type, const char *logString)
Definition: PoolImpl.cc:104
std::tr1::unordered_set< IdString > _locale2Solver
Definition: PoolImpl.h:280
sat::StringQueue _autoinstalled
Definition: PoolImpl.h:287
int _addHelix(::_Repo *repo_r, FILE *file_r)
Adding helix file to a repo.
Definition: PoolImpl.cc:311
std::tr1::unordered_set< Locale > LocaleSet
Definition: Locale.h:28
#define _(MSG)
Return translated text.
Definition: Gettext.h:21
static PoolImpl & myPool()
Definition: PoolImpl.cc:167
BOOST_MPL_ASSERT_RELATION(noId,==, STRID_NULL)
std::ostream & dumpRangeLine(std::ostream &str, _Iterator begin, _Iterator end)
Print range defined by iterators (single line style).
Definition: LogTools.h:114
static CompatSet compatSet(const Arch &targetArch_r)
Return a set of all Arch's compatibleWith a targetArch_r.
Definition: Arch.cc:530
std::string asString(const Patch::SeverityFlag &obj)
Definition: Patch.cc:166
SerialNumber _serial
Serial number.
Definition: PoolImpl.h:271
scoped_ptr< MultiversionList > _multiversionListPtr
Definition: PoolImpl.h:284
::_Repo * getRepo(RepoIdType id_r) const
Definition: PoolImpl.h:144
std::string code() const
Return the locale code.
Definition: Locale.cc:207
static Modalias & instance()
Singleton access.
Definition: Modalias.cc:198
void depSetDirty(const char *a1=0, const char *a2=0, const char *a3=0)
Invalidate housekeeping data (e.g.
Definition: PoolImpl.cc:236
Base class for Exception.
Definition: Exception.h:143
scoped_ptr< std::set< std::string > > _requiredFilesystemsPtr
filesystems mentioned in /etc/sysconfig/storage
Definition: PoolImpl.h:290
void setTextLocale(const Locale &locale_r)
Definition: PoolImpl.cc:415
void clear()
Clear the queue.
Definition: Queue.cc:94
std::map< RepoIdType, RepoInfo > _repoinfos
Additional RepoInfo.
Definition: PoolImpl.h:275
int LIBSOLV_DEBUGMASK()
Definition: PoolImpl.cc:56
A sat capability.
Definition: Capability.h:59
void prepare() const
Update housekeeping data (e.g.
Definition: PoolImpl.cc:247
static const std::string & systemRepoAlias()
Reserved system repository alias .
Definition: PoolImpl.cc:89
static const IdType noId(0)
Url url() const
Pars pro toto: The first repository url.
Definition: RepoInfo.h:120
Global sat-pool.
Definition: Pool.h:43
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
SolvableIterator solvablesBegin() const
Iterator to the first Solvable.
Definition: Pool.cc:97
Capability rhs() const
Definition: Capability.h:345
Locale textLocale() const
The locale for translated texts zypp uses.
Definition: ZConfig.cc:722
IdStringSet MultiversionList
Definition: PoolImpl.h:232
Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference).
Definition: MediaPriority.h:43
const MultiversionList & multiversionList() const
Definition: PoolImpl.h:234
#define _DBG(GROUP)
Definition: Logger.h:55
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:974
void _postRepoAdd(::_Repo *repo_r)
Helper postprocessing the repo after adding solv or helix files.
Definition: PoolImpl.cc:320
std::string hexdecode(const C_Str &str_r)
Decode hexencoded XX sequences.
Definition: String.cc:134
sat::detail::IdType id() const
Expert backdoor.
Definition: Capability.h:244
bool remember(unsigned serial_r) const
Return isDirty, storing serial_r as new value.
Definition: SerialNumber.h:160
::_Pool * _pool
sat-pool.
Definition: PoolImpl.h:269
static detail::IdType nsCallback(::_Pool *, void *data, detail::IdType lhs, detail::IdType rhs)
Callback to resolve namespace dependencies (language, modalias, filesystem, etc.).
Definition: PoolImpl.cc:115