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