libzypp  17.23.8
Testcase.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 <sstream>
15 #include <streambuf>
16 
17 #define ZYPP_USE_RESOLVER_INTERNALS
18 
20 #include <zypp/base/Logger.h>
21 #include <zypp/base/LogControl.h>
22 #include <zypp/base/GzStream.h>
23 #include <zypp/base/String.h>
24 #include <zypp/base/PtrTypes.h>
25 #include <zypp/base/NonCopyable.h>
27 
29 
30 #include <zypp/ZConfig.h>
31 #include <zypp/PathInfo.h>
32 #include <zypp/ResPool.h>
33 #include <zypp/Repository.h>
35 
39 
40 using std::endl;
41 
43 namespace zypp
44 {
45  namespace solver
47  {
48  namespace detail
50  {
51 
52 #define TAB "\t"
53 #define TAB2 "\t\t"
54 
55 using namespace zypp::str;
56 
57 //---------------------------------------------------------------------------
58 
59 inline std::string xml_escape( const std::string &text )
60 {
61  return zypp::xml::escape(text);
62 }
63 
64 inline std::string xml_tag_enclose( const std::string &text, const std::string &tag, bool escape = false )
65 {
66  std::string result;
67  result += "<" + tag + ">";
68 
69  if ( escape)
70  result += xml_escape(text);
71  else
72  result += text;
73 
74  result += "</" + tag + ">";
75  return result;
76 }
77 
78 template<class T>
79 std::string helixXML( const T &obj ); //undefined
80 
81 template<>
82 std::string helixXML( const Edition &edition )
83 {
84  std::stringstream str;
85  str << xml_tag_enclose(edition.version(), "version");
86  if (!edition.release().empty())
87  str << xml_tag_enclose(edition.release(), "release");
88  if (edition.epoch() != Edition::noepoch)
89  str << xml_tag_enclose(numstring(edition.epoch()), "epoch");
90  return str.str();
91 }
92 
93 template<>
94 std::string helixXML( const Arch &arch )
95 {
96  std::stringstream str;
97  str << xml_tag_enclose(arch.asString(), "arch");
98  return str.str();
99 }
100 
101 template<>
102 std::string helixXML( const Capability &cap )
103 {
104  std::stringstream str;
105  CapDetail detail = cap.detail();
106  if (detail.isSimple()) {
107  if (detail.isVersioned()) {
108  str << "<dep name='" << xml_escape(detail.name().asString()) << "'"
109  << " op='" << xml_escape(detail.op().asString()) << "'"
110  << " version='" << xml_escape(detail.ed().version()) << "'";
111  if (!detail.ed().release().empty())
112  str << " release='" << xml_escape(detail.ed().release()) << "'";
113  if (detail.ed().epoch() != Edition::noepoch)
114  str << " epoch='" << xml_escape(numstring(detail.ed().epoch())) << "'";
115  str << " />" << endl;
116  } else {
117  str << "<dep name='" << xml_escape(cap.asString()) << "' />" << endl;
118  }
119  } else if (detail.isExpression()) {
120  if (detail.capRel() == CapDetail::CAP_AND
121  && detail.lhs().detail().isNamed()
122  && detail.rhs().detail().isNamed()) {
123  // packageand dependency
124  str << "<dep name='packageand("
125  << IdString(detail.lhs().id()) << ":"
126  << IdString(detail.rhs().id()) << ")' />" << endl;
127  } else if (detail.capRel() == CapDetail::CAP_NAMESPACE
128  && detail.lhs().id() == NAMESPACE_OTHERPROVIDERS) {
129  str << "<dep name='otherproviders("
130  << IdString(detail.rhs().id()) << ")' />" << endl;
131  } else {
132  // modalias ?
133  IdString packageName;
134  if (detail.capRel() == CapDetail::CAP_AND) {
135  packageName = IdString(detail.lhs().id());
136  detail = detail.rhs().detail();
137  }
138  if (detail.capRel() == CapDetail::CAP_NAMESPACE
139  && detail.lhs().id() == NAMESPACE_MODALIAS) {
140  str << "<dep name='modalias(";
141  if (!packageName.empty())
142  str << packageName << ":";
143  str << IdString(detail.rhs().id()) << ")' />" << endl;
144  } else {
145  str << "<!--- ignoring '" << xml_escape(cap.asString()) << "' -->" << endl;
146  }
147  }
148  } else {
149  str << "<!--- ignoring '" << xml_escape(cap.asString()) << "' -->" << endl;
150  }
151 
152  return str.str();
153 }
154 
155 template<>
156 std::string helixXML( const Capabilities &caps )
157 {
158  std::stringstream str;
160  str << endl;
161  for ( ; it != caps.end(); ++it)
162  {
163  str << TAB2 << helixXML((*it));
164  }
165  str << TAB;
166  return str.str();
167 }
168 
169 template<>
170 std::string helixXML( const CapabilitySet &caps )
171 {
172  std::stringstream str;
173  CapabilitySet::const_iterator it = caps.begin();
174  str << endl;
175  for ( ; it != caps.end(); ++it)
176  {
177  str << TAB2 << helixXML((*it));
178  }
179  str << TAB;
180  return str.str();
181 }
182 
183 inline std::string helixXML( const PoolItem & obj, Dep deptag_r )
184 {
185  std::stringstream out;
186  Capabilities caps( obj[deptag_r] );
187  if ( ! caps.empty() )
188  out << TAB << xml_tag_enclose(helixXML(caps), deptag_r.asString()) << endl;
189  return out.str();
190 }
191 
192 std::string helixXML( const PoolItem & item )
193 {
194  std::stringstream str;
195  str << "<" << item.kind() << ">" << endl;
196  str << TAB << xml_tag_enclose( item.name(), "name", true ) << endl;
197  str << TAB << xml_tag_enclose( item.vendor().asString(), "vendor", true ) << endl;
198  str << TAB << xml_tag_enclose( item.buildtime().asSeconds(), "buildtime", true ) << endl;
199  if ( isKind<Package>( item ) ) {
200  str << TAB << "<history>" << endl << TAB << "<update>" << endl;
201  str << TAB2 << helixXML( item.arch() ) << endl;
202  str << TAB2 << helixXML( item.edition() ) << endl;
203  str << TAB << "</update>" << endl << TAB << "</history>" << endl;
204  } else {
205  str << TAB << helixXML( item.arch() ) << endl;
206  str << TAB << helixXML( item.edition() ) << endl;
207  }
208  str << helixXML( item, Dep::PROVIDES );
209  str << helixXML( item, Dep::PREREQUIRES );
210  str << helixXML( item, Dep::CONFLICTS );
211  str << helixXML( item, Dep::OBSOLETES );
212  str << helixXML( item, Dep::REQUIRES );
213  str << helixXML( item, Dep::RECOMMENDS );
214  str << helixXML( item, Dep::ENHANCES );
215  str << helixXML( item, Dep::SUPPLEMENTS );
216  str << helixXML( item, Dep::SUGGESTS );
217 
218  str << "</" << item.kind() << ">" << endl;
219  return str.str();
220 }
221 
223 //
224 // CLASS NAME : HelixResolvable
230 
231  private:
232  std::string dumpFile; // Path of the generated testcase
234 
235  public:
236  HelixResolvable (const std::string & path);
237  ~HelixResolvable ();
238 
239  void addResolvable (const PoolItem item)
240  { *file << helixXML (item); }
241 
242  std::string filename ()
243  { return dumpFile; }
244 };
245 
246 DEFINE_PTR_TYPE(HelixResolvable);
247 IMPL_PTR_TYPE(HelixResolvable);
248 
249 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
250 
251 HelixResolvable::HelixResolvable(const std::string & path)
252  :dumpFile (path)
253 {
254  file = new ofgzstream(path.c_str());
255  if (!file) {
256  ZYPP_THROW (Exception( "Can't open " + path ) );
257  }
258 
259  *file << "<channel><subchannel>" << endl;
260 }
261 
263 {
264  *file << "</subchannel></channel>" << endl;
265  delete(file);
266 }
267 
269 //
270 // CLASS NAME : HelixControl
276 
277  private:
278  std::string dumpFile; // Path of the generated testcase
279  std::ofstream *file;
280  bool _inSetup;
281 
282  public:
283  HelixControl (const std::string & controlPath,
284  const RepositoryTable & sourceTable,
285  const Arch & systemArchitecture,
286  const target::Modalias::ModaliasList & modaliasList,
287  const std::set<std::string> & multiversionSpec,
288  const std::string & systemPath);
289  ~HelixControl ();
290 
291  void closeSetup()
292  {
293  if ( _inSetup )
294  {
295  *file << "</setup>" << endl << "<trial>" << endl;
296  _inSetup = false;
297  }
298  }
299 
300  std::ostream & writeTag()
301  { return *file << (_inSetup ? TAB : ""); }
302 
303  void addTagIf( const std::string & tag_r, bool yesno_r = true )
304  {
305  if ( yesno_r )
306  writeTag() << "<" << tag_r << "/>" << endl;
307  }
308 
309  void installResolvable( const PoolItem & pi_r );
310  void lockResolvable( const PoolItem & pi_r );
311  void keepResolvable( const PoolItem & pi_r );
312  void deleteResolvable( const PoolItem & pi_r );
313  void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
314  void addUpgradeRepos( const std::set<Repository> & upgradeRepos_r );
315 
316  std::string filename () { return dumpFile; }
317 };
318 
319 HelixControl::HelixControl(const std::string & controlPath,
320  const RepositoryTable & repoTable,
321  const Arch & systemArchitecture,
322  const target::Modalias::ModaliasList & modaliasList,
323  const std::set<std::string> & multiversionSpec,
324  const std::string & systemPath)
325  :dumpFile (controlPath)
326  ,_inSetup( true )
327 {
328  file = new std::ofstream(controlPath.c_str());
329  if (!file) {
330  ZYPP_THROW (Exception( "Can't open " + controlPath ) );
331  }
332 
333  *file << "<?xml version=\"1.0\"?>" << endl
334  << "<!-- libzypp resolver testcase -->" << endl
335  << "<test>" << endl
336  << "<setup arch=\"" << systemArchitecture << "\">" << endl
337  << TAB << "<system file=\"" << systemPath << "\"/>" << endl << endl;
338  for ( RepositoryTable::const_iterator it = repoTable.begin();
339  it != repoTable.end(); ++it ) {
340  RepoInfo repo = it->first.info();
341  *file << TAB << "<!-- " << endl
342  << TAB << "- alias : " << repo.alias() << endl;
343  for ( RepoInfo::urls_const_iterator itUrl = repo.baseUrlsBegin();
344  itUrl != repo.baseUrlsEnd();
345  ++itUrl )
346  {
347  *file << TAB << "- url : " << *itUrl << endl;
348  }
349  *file << TAB << "- path : " << repo.path() << endl;
350  *file << TAB << "- type : " << repo.type() << endl;
351  *file << TAB << "- generated : " << (it->first.generatedTimestamp()).form( "%Y-%m-%d %H:%M:%S" ) << endl;
352  *file << TAB << "- outdated : " << (it->first.suggestedExpirationTimestamp()).form( "%Y-%m-%d %H:%M:%S" ) << endl;
353  *file << TAB << " -->" << endl;
354 
355  *file << TAB << "<channel file=\"" << str::numstring((long)it->first.id())
356  << "-package.xml.gz\" name=\"" << repo.alias() << "\""
357  << " priority=\"" << repo.priority()
358  << "\" />" << endl << endl;
359  }
360 
361  // HACK: directly access sat::pool
362  const sat::Pool & satpool( sat::Pool::instance() );
363 
364  // RequestedLocales
365  const LocaleSet & addedLocales( satpool.getAddedRequestedLocales() );
366  const LocaleSet & removedLocales( satpool.getRemovedRequestedLocales() );
367  const LocaleSet & requestedLocales( satpool.getRequestedLocales() );
368 
369  for ( Locale l : requestedLocales )
370  {
371  const char * fate = ( addedLocales.count(l) ? "\" fate=\"added" : "" );
372  *file << TAB << "<locale name=\"" << l << fate << "\" />" << endl;
373  }
374  for ( Locale l : removedLocales )
375  {
376  *file << TAB << "<locale name=\"" << l << "\" fate=\"removed\" />" << endl;
377  }
378 
379  // AutoInstalled
380  for ( IdString::IdType n : satpool.autoInstalled() )
381  {
382  *file << TAB << "<autoinst name=\"" << IdString(n) << "\" />" << endl;
383  }
384 
385 
386 
387  for_( it, modaliasList.begin(), modaliasList.end() ) {
388  *file << TAB << "<modalias name=\"" << xml_escape(*it)
389  << "\" />" << endl;
390  }
391 
392  for_( it, multiversionSpec.begin(), multiversionSpec.end() ) {
393  *file << TAB << "<multiversion name=\"" << *it
394  << "\" />" << endl;
395  }
396 
397  // setup continued outside....
398 }
399 
401 {
402  closeSetup(); // in case it is still open
403  *file << "</trial>" << endl
404  << "</test>" << endl;
405  delete(file);
406 }
407 
409 {
410  *file << "<install channel=\"" << pi_r.repoInfo().alias() << "\""
411  << " kind=\"" << pi_r.kind() << "\""
412  << " name=\"" << pi_r.name() << "\""
413  << " arch=\"" << pi_r.arch() << "\""
414  << " version=\"" << pi_r.edition().version() << "\""
415  << " release=\"" << pi_r.edition().release() << "\""
416  << " status=\"" << pi_r.status() << "\""
417  << "/>" << endl;
418 }
419 
421 {
422  *file << "<lock channel=\"" << pi_r.repoInfo().alias() << "\""
423  << " kind=\"" << pi_r.kind() << "\""
424  << " name=\"" << pi_r.name() << "\""
425  << " arch=\"" << pi_r.arch() << "\""
426  << " version=\"" << pi_r.edition().version() << "\""
427  << " release=\"" << pi_r.edition().release() << "\""
428  << " status=\"" << pi_r.status() << "\""
429  << "/>" << endl;
430 }
431 
433 {
434  *file << "<keep channel=\"" << pi_r.repoInfo().alias() << "\""
435  << " kind=\"" << pi_r.kind() << "\""
436  << " name=\"" << pi_r.name() << "\""
437  << " arch=\"" << pi_r.arch() << "\""
438  << " version=\"" << pi_r.edition().version() << "\""
439  << " release=\"" << pi_r.edition().release() << "\""
440  << " status=\"" << pi_r.status() << "\""
441  << "/>" << endl;
442 }
443 
445 {
446  *file << "<uninstall kind=\"" << pi_r.kind() << "\""
447  << " name=\"" << pi_r.name() << "\""
448  << " status=\"" << pi_r.status() << "\""
449  << "/>" << endl;
450 }
451 
452 void HelixControl::addDependencies (const CapabilitySet & capRequire, const CapabilitySet & capConflict)
453 {
454  for (CapabilitySet::const_iterator iter = capRequire.begin(); iter != capRequire.end(); iter++) {
455  *file << "<addRequire " << " name=\"" << iter->asString() << "\"" << "/>" << endl;
456  }
457  for (CapabilitySet::const_iterator iter = capConflict.begin(); iter != capConflict.end(); iter++) {
458  *file << "<addConflict " << " name=\"" << iter->asString() << "\"" << "/>" << endl;
459  }
460 }
461 
462 void HelixControl::addUpgradeRepos( const std::set<Repository> & upgradeRepos_r )
463 {
464  for_( it, upgradeRepos_r.begin(), upgradeRepos_r.end() )
465  {
466  *file << "<upgradeRepo name=\"" << it->alias() << "\"/>" << endl;
467  }
468 }
469 
470 //---------------------------------------------------------------------------
471 
472 Testcase::Testcase()
473  :dumpPath("/var/log/YaST2/solverTestcase")
474 {}
475 
476 Testcase::Testcase(const std::string & path)
477  :dumpPath(path)
478 {}
479 
480 Testcase::~Testcase()
481 {}
482 
483 bool Testcase::createTestcase(Resolver & resolver, bool dumpPool, bool runSolver)
484 {
485  PathInfo path (dumpPath);
486 
487  if ( !path.isExist() ) {
488  if (zypp::filesystem::assert_dir (dumpPath)!=0) {
489  ERR << "Cannot create directory " << dumpPath << endl;
490  return false;
491  }
492  } else {
493  if (!path.isDir()) {
494  ERR << dumpPath << " is not a directory." << endl;
495  return false;
496  }
497  // remove old stuff if pool will be dump
498  if (dumpPool)
499  zypp::filesystem::clean_dir (dumpPath);
500  }
501 
502  if (runSolver) {
504  zypp::base::LogControl::instance().logfile( dumpPath +"/y2log" );
506 
507  resolver.resolvePool();
508  }
509 
510  ResPool pool = resolver.pool();
511  RepositoryTable repoTable;
512  PoolItemList items_to_install;
513  PoolItemList items_to_remove;
514  PoolItemList items_locked;
515  PoolItemList items_keep;
516  HelixResolvable_Ptr system = NULL;
517 
518  if (dumpPool)
519  system = new HelixResolvable(dumpPath + "/solver-system.xml.gz");
520 
521  for ( const PoolItem & pi : pool )
522  {
523  if ( system && pi.status().isInstalled() ) {
524  // system channel
525  system->addResolvable( pi );
526  } else {
527  // repo channels
528  Repository repo = pi.repository();
529  if (dumpPool) {
530  if (repoTable.find (repo) == repoTable.end()) {
531  repoTable[repo] = new HelixResolvable(dumpPath + "/"
532  + str::numstring((long)repo.id())
533  + "-package.xml.gz");
534  }
535  repoTable[repo]->addResolvable( pi );
536  }
537  }
538 
539  if ( pi.status().isToBeInstalled()
540  && !(pi.status().isBySolver())) {
541  items_to_install.push_back( pi );
542  }
543  if ( pi.status().isKept()
544  && !(pi.status().isBySolver())) {
545  items_keep.push_back( pi );
546  }
547  if ( pi.status().isToBeUninstalled()
548  && !(pi.status().isBySolver())) {
549  items_to_remove.push_back( pi );
550  }
551  if ( pi.status().isLocked()
552  && !(pi.status().isBySolver())) {
553  items_locked.push_back( pi );
554  }
555  }
556 
557  // writing control file "*-test.xml"
558  HelixControl control (dumpPath + "/solver-test.xml",
559  repoTable,
560  ZConfig::instance().systemArchitecture(),
561  target::Modalias::instance().modaliasList(),
562  ZConfig::instance().multiversionSpec(),
563  "solver-system.xml.gz");
564 
565  // In <setup>: resolver flags,...
566  control.writeTag() << "<focus value=\"" << resolver.focus() << "\"/>" << endl;
567 
568  control.addTagIf( "ignorealreadyrecommended", resolver.ignoreAlreadyRecommended() );
569  control.addTagIf( "onlyRequires", resolver.onlyRequires() );
570  control.addTagIf( "forceResolve", resolver.forceResolve() );
571 
572  control.addTagIf( "cleandepsOnRemove", resolver.cleandepsOnRemove() );
573 
574  control.addTagIf( "allowDowngrade", resolver.allowDowngrade() );
575  control.addTagIf( "allowNameChange", resolver.allowNameChange() );
576  control.addTagIf( "allowArchChange", resolver.allowArchChange() );
577  control.addTagIf( "allowVendorChange", resolver.allowVendorChange() );
578 
579  control.addTagIf( "dupAllowDowngrade", resolver.dupAllowDowngrade() );
580  control.addTagIf( "dupAllowNameChange", resolver.dupAllowNameChange() );
581  control.addTagIf( "dupAllowArchChange", resolver.dupAllowArchChange() );
582  control.addTagIf( "dupAllowVendorChange", resolver.dupAllowVendorChange() );
583 
584  control.closeSetup();
585  // Entering <trial>...
586 
587  for ( const PoolItem & pi : items_to_install )
588  { control.installResolvable( pi ); }
589 
590  for ( const PoolItem & pi : items_locked )
591  { control.lockResolvable( pi ); }
592 
593  for ( const PoolItem & pi : items_keep )
594  { control.keepResolvable( pi ); }
595 
596  for ( const PoolItem & pi : items_to_remove )
597  { control.deleteResolvable( pi ); }
598 
599  control.addDependencies (resolver.extraRequires(), resolver.extraConflicts());
600  control.addDependencies (SystemCheck::instance().requiredSystemCap(),
601  SystemCheck::instance().conflictSystemCap());
602  control.addUpgradeRepos( resolver.upgradeRepos() );
603 
604  control.addTagIf( "distupgrade", resolver.isUpgradeMode() );
605  control.addTagIf( "update", resolver.isUpdateMode() );
606  control.addTagIf( "verify", resolver.isVerifyingMode() );
607 
608  return true;
609 }
610 
611 
613  };// namespace detail
616  };// namespace solver
619 };// namespace zypp
zypp::CapDetail::lhs
Capability lhs() const
Definition: Capability.h:352
zypp::Capability::id
sat::detail::IdType id() const
Expert backdoor.
Definition: Capability.h:253
ResPool.h
zypp::IdString::IdType
sat::detail::IdType IdType
Definition: IdString.h:44
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition: Pool.h:55
zypp::solver::detail::RepositoryTable
std::map< Repository, HelixResolvable_Ptr > RepositoryTable
Definition: Testcase.cc:249
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
zypp::filesystem::assert_dir
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
Definition: PathInfo.cc:315
zypp::solver::detail::HelixControl::~HelixControl
~HelixControl()
Definition: Testcase.cc:400
zypp::Capability::asString
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: Capability.h:158
LogControl.h
zypp::Dep::SUPPLEMENTS
static const Dep SUPPLEMENTS
Definition: Dep.h:50
zypp::solver::detail::HelixResolvable::dumpFile
std::string dumpFile
Definition: Testcase.cc:232
PathInfo.h
Resolver.h
zypp::CapDetail::isVersioned
bool isVersioned() const
Definition: Capability.h:337
zypp::CapDetail::capRel
CapRel capRel() const
Definition: Capability.h:353
zypp::filesystem::clean_dir
int clean_dir(const Pathname &path)
Like 'rm -r DIR/ *'.
Definition: PathInfo.cc:429
Modalias.h
zypp::Edition::noepoch
static const epoch_t noepoch
Value representing noepoch.
Definition: Edition.h:67
GzStream.h
zypp::sat::Pool::autoInstalled
Queue autoInstalled() const
Get ident list of all autoinstalled solvables.
Definition: Pool.cc:264
zypp::solver::detail::HelixControl::file
std::ofstream * file
Definition: Testcase.cc:279
zypp::sat::SolvableType::buildtime
Date buildtime() const
Definition: SolvableType.h:87
zypp::Exception
Base class for Exception.
Definition: Exception.h:145
zypp::solver::detail::HelixControl::deleteResolvable
void deleteResolvable(const PoolItem &pi_r)
Definition: Testcase.cc:444
zypp::CapDetail::ed
Edition ed() const
Definition: Capability.h:347
zypp::sat::SolvableType::repoInfo
RepoInfo repoInfo() const
Definition: SolvableType.h:76
zypp::solver::detail::helixXML
std::string helixXML(const T &obj)
zypp::RepoInfo
What is known about a repository.
Definition: RepoInfo.h:71
zypp::RepoInfo::urls_const_iterator
transform_iterator< repo::RepoVariablesUrlReplacer, url_set::const_iterator > urls_const_iterator
Definition: RepoInfo.h:105
zypp::solver::detail::HelixResolvable::~HelixResolvable
~HelixResolvable()
Definition: Testcase.cc:262
zypp::Dep::ENHANCES
static const Dep ENHANCES
Definition: Dep.h:49
zypp::sat::SolvableType::edition
Edition edition() const
Definition: SolvableType.h:71
zypp::Capabilities::begin
const_iterator begin() const
Iterator pointing to the first Capability.
Definition: Capabilities.h:169
zypp::solver::detail::IMPL_PTR_TYPE
IMPL_PTR_TYPE(SATResolver)
ZConfig.h
zypp::Edition::epoch
epoch_t epoch() const
Epoch.
Definition: Edition.cc:82
zypp::Edition
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
zypp::base::ReferenceCounted
Base class for reference counted objects.
Definition: ReferenceCounted.h:33
zypp::CapDetail::isNamed
bool isNamed() const
Definition: Capability.h:336
ZYPP_THROW
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition: Exception.h:392
zypp::solver::detail::DEFINE_PTR_TYPE
DEFINE_PTR_TYPE(HelixResolvable)
zypp::RepoInfo::priority
unsigned priority() const
Repository priority for solver.
Definition: RepoInfo.cc:366
PtrTypes.h
zypp::sat::Pool::getRemovedRequestedLocales
const LocaleSet & getRemovedRequestedLocales() const
Removed since last initRequestedLocales.
Definition: Pool.cc:253
zypp::CapDetail::op
Rel op() const
Definition: Capability.h:346
zypp::Dep::REQUIRES
static const Dep REQUIRES
Definition: Dep.h:44
zypp::Arch
Architecture.
Definition: Arch.h:36
zypp::solver::detail::HelixControl::addDependencies
void addDependencies(const CapabilitySet &capRequire, const CapabilitySet &capConflict)
Definition: Testcase.cc:452
zypp::solver::detail::HelixResolvable::file
ofgzstream * file
Definition: Testcase.cc:233
zypp::Edition::release
std::string release() const
Release.
Definition: Edition.cc:110
zypp::solver::detail::HelixResolvable::HelixResolvable
HelixResolvable(const std::string &path)
Definition: Testcase.cc:251
zypp::solver::detail::xml_escape
std::string xml_escape(const std::string &text)
Definition: Testcase.cc:59
zypp::CapDetail::isExpression
bool isExpression() const
Definition: Capability.h:339
XmlEscape.h
zypp::solver::detail::HelixResolvable::addResolvable
void addResolvable(const PoolItem item)
Definition: Testcase.cc:239
zypp::sat::SolvableType::vendor
IdString vendor() const
Definition: SolvableType.h:73
zypp::IdString::asString
std::string asString() const
Conversion to std::string
Definition: IdString.h:91
zypp::sat::Pool
Global sat-pool.
Definition: Pool.h:46
zypp::Dep::PREREQUIRES
static const Dep PREREQUIRES
Definition: Dep.h:43
zypp::IdString
Access to the sat-pools string space.
Definition: IdString.h:41
zypp::solver::detail::HelixControl
Creates a file in helix format which contains all controll action of a testcase ( file is known as *-...
Definition: Testcase.cc:275
zypp::CapabilitySet
std::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
zypp::solver::detail::HelixControl::keepResolvable
void keepResolvable(const PoolItem &pi_r)
Definition: Testcase.cc:432
zypp::solver::detail::HelixControl::HelixControl
HelixControl(const std::string &controlPath, const RepositoryTable &sourceTable, const Arch &systemArchitecture, const target::Modalias::ModaliasList &modaliasList, const std::set< std::string > &multiversionSpec, const std::string &systemPath)
Definition: Testcase.cc:319
PoolImpl.h
zypp::solver::detail::HelixControl::closeSetup
void closeSetup()
Definition: Testcase.cc:291
TAB2
#define TAB2
Definition: Testcase.cc:53
zypp::xml::escape
detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
Definition: XmlEscape.h:51
zypp::sat::SolvableType::name
std::string name() const
Definition: SolvableType.h:70
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Logger.h
zypp::repo::RepoInfoBase::alias
std::string alias() const
unique identifier for this source.
Definition: RepoInfoBase.cc:111
zypp::solver::detail::HelixControl::dumpFile
std::string dumpFile
Definition: Testcase.cc:278
zypp::Capabilities::end
const_iterator end() const
Iterator pointing behind the last Capability.
Definition: Capabilities.h:172
zypp::Dep::SUGGESTS
static const Dep SUGGESTS
Definition: Dep.h:48
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:35
zypp::solver::detail::HelixControl::addUpgradeRepos
void addUpgradeRepos(const std::set< Repository > &upgradeRepos_r)
Definition: Testcase.cc:462
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition: Resolver.cc:126
zypp::CapDetail::CAP_NAMESPACE
Definition: Capability.h:318
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::Dep::RECOMMENDS
static const Dep RECOMMENDS
Definition: Dep.h:47
zypp::str
String related utilities and Regular expression matching.
Definition: PtrTypes.h:28
zypp::str::numstring
std::string numstring(char n, int w=0)
Definition: String.h:286
zypp::Edition::version
std::string version() const
Version.
Definition: Edition.cc:94
zypp::RepoInfo::baseUrlsBegin
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
Definition: RepoInfo.cc:703
zypp::str::escape
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
Definition: String.cc:362
SystemCheck.h
zypp::solver::detail::HelixControl::lockResolvable
void lockResolvable(const PoolItem &pi_r)
Definition: Testcase.cc:420
zypp::Rel::asString
const std::string & asString() const
String representation of relational operator.
Definition: Rel.cc:105
zypp::Dep::OBSOLETES
static const Dep OBSOLETES
Definition: Dep.h:46
zypp::sat::SolvableType::arch
Arch arch() const
Definition: SolvableType.h:72
zypp::Dep::CONFLICTS
static const Dep CONFLICTS
Definition: Dep.h:45
zypp::sat::Pool::getAddedRequestedLocales
const LocaleSet & getAddedRequestedLocales() const
Added since last initRequestedLocales.
Definition: Pool.cc:252
zypp::Dep::PROVIDES
static const Dep PROVIDES
Definition: Dep.h:42
zypp::sat::SolvableType::kind
ResKind kind() const
Definition: SolvableType.h:63
zypp::Date::asSeconds
std::string asSeconds() const
Convert to string representation of calendar time in numeric form (like "1029255142").
Definition: Date.h:126
zypp::Arch::asString
const std::string & asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: Arch.cc:485
zypp::solver::detail::HelixResolvable::filename
std::string filename()
Definition: Testcase.cc:242
zypp::base::LogControl::TmpExcessive
Turn on excessive logging for the lifetime of this object.
Definition: LogControl.h:161
zypp::Capability
A sat capability.
Definition: Capability.h:59
ReferenceCounted.h
zypp::Capability::detail
CapDetail detail() const
Helper providing more detailed information about a Capability.
Definition: Capability.h:379
zypp::PoolItem::status
ResStatus & status() const
Returns the current status.
Definition: PoolItem.cc:204
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:28
zypp::detail::fXstream
Common template to define ifgzstream/ofgzstream reading/writing compressed files.
Definition: fXstream.h:26
TAB
#define TAB
Definition: Testcase.cc:52
zypp::solver::detail::HelixControl::writeTag
std::ostream & writeTag()
Definition: Testcase.cc:300
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
String.h
ERR
#define ERR
Definition: Logger.h:81
Repository.h
zypp::solver::detail::xml_tag_enclose
std::string xml_tag_enclose(const std::string &text, const std::string &tag, bool escape=false)
Definition: Testcase.cc:64
zypp::base::LogControl::TmpLineWriter
Exchange LineWriter for the lifetime of this object.
Definition: LogControl.h:170
zypp::target::Modalias::ModaliasList
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
zypp::CapDetail::name
IdString name() const
Definition: Capability.h:345
zypp::solver::detail::HelixControl::installResolvable
void installResolvable(const PoolItem &pi_r)
Definition: Testcase.cc:408
str
String related utilities and Regular expression matching.
zypp::RepoInfo::baseUrlsEnd
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
Definition: RepoInfo.cc:706
Testcase.h
zypp::solver::detail::HelixControl::filename
std::string filename()
Definition: Testcase.cc:316
zypp::CapDetail::isSimple
bool isSimple() const
Definition: Capability.h:338
zypp::solver::detail::HelixControl::addTagIf
void addTagIf(const std::string &tag_r, bool yesno_r=true)
Definition: Testcase.cc:303
zypp::Dep
Enumeration class of dependency types.
Definition: Dep.h:29
zypp::Capabilities::empty
bool empty() const
Whether the container is empty.
Definition: Capabilities.h:62
zypp::solver::detail::HelixControl::_inSetup
bool _inSetup
Definition: Testcase.cc:280
zypp::Capabilities::const_iterator
Capabilities iterator.
Definition: Capabilities.h:98
zypp::target::Modalias::instance
static Modalias & instance()
Singleton access.
Definition: Modalias.cc:219
zypp::Locale
'Language[_Country]' codes.
Definition: Locale.h:49
zypp::CapDetail::rhs
Capability rhs() const
Definition: Capability.h:354
zypp::IdString::empty
constexpr bool empty() const
Whether the string is empty.
Definition: IdString.h:80
zypp::Capabilities
Container of Capability (currently read only).
Definition: Capabilities.h:35
zypp::base::LogControl::logfile
void logfile(const Pathname &logfile_r)
Set path for the logfile.
Definition: LogControl.cc:464
zypp::CapDetail::CAP_AND
Definition: Capability.h:315
zypp::RepoInfo::type
repo::RepoType type() const
Type of repository,.
Definition: RepoInfo.cc:658
zypp::solver::detail::HelixResolvable
Creates a file in helix format which includes all available or installed packages,...
Definition: Testcase.cc:229
zypp::CapDetail
Helper providing more detailed information about a Capability.
Definition: Capability.h:298
zypp::RepoInfo::path
Pathname path() const
Repository path.
Definition: RepoInfo.cc:691
NonCopyable.h
zypp::base::LogControl::instance
static LogControl instance()
Singleton access.
Definition: LogControl.h:102
zypp::sat::Pool::getRequestedLocales
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:245
zypp::ofgzstream
detail::fXstream< std::ostream, gzstream_detail::fgzstreambuf > ofgzstream
ostream writing gzip files.
Definition: GzStream.h:162