51 using namespace zypp::str;
63 result +=
"<" + tag +
">";
70 result +=
"</" + tag +
">";
75 std::string
helixXML(
const T &obj );
111 str <<
" />" << endl;
120 str <<
"<dep name='packageand("
124 && detail.
lhs().
id() == NAMESPACE_OTHERPROVIDERS) {
125 str <<
"<dep name='otherproviders("
132 detail = detail.rhs().detail();
135 && detail.
lhs().
id() == NAMESPACE_MODALIAS) {
136 str <<
"<dep name='modalias(";
137 if (!packageName.
empty())
138 str << packageName <<
":";
157 for ( ; it != caps.
end(); ++it)
169 CapabilitySet::const_iterator it = caps.begin();
171 for ( ; it != caps.end(); ++it)
183 if ( ! caps.empty() )
192 str <<
"<" <<
toLower (resolvable->kind().asString()) <<
">" << 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;
199 str <<
TAB2 <<
helixXML (resolvable->edition()) << endl;
200 str <<
TAB <<
"</update>" << endl <<
TAB <<
"</history>" << endl;
202 str <<
TAB <<
helixXML (resolvable->arch()) << endl;
203 str <<
TAB <<
helixXML (resolvable->edition()) << endl;
215 str <<
"</" <<
toLower (resolvable->kind().asString()) <<
">" << endl;
256 *
file <<
"<channel><subchannel>" << endl;
261 *
file <<
"</subchannel></channel>" << endl;
282 const Arch & systemArchitecture,
285 const std::set<std::string> & multiversionSpec,
286 const std::string & systemPath);
294 *
file <<
"</setup>" << endl <<
"<trial>" << endl;
299 void addTagIf(
const std::string & tag_r,
bool yesno_r =
true )
321 const Arch & systemArchitecture,
324 const std::set<std::string> & multiversionSpec,
325 const std::string & systemPath)
326 :dumpFile (controlPath)
329 file =
new ofstream(controlPath.c_str());
334 *
file <<
"<?xml version=\"1.0\"?>" << endl
335 <<
"<!-- testcase generated by YaST -->" << 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 ) {
342 *
file <<
TAB <<
"<!-- " << endl
343 <<
TAB <<
"- alias : " << repo.
alias() << endl;
348 *
file <<
TAB <<
"- url : " << *itUrl << endl;
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;
357 <<
"-package.xml.gz\" name=\"" << repo.
alias() <<
"\""
358 <<
" priority=\"" << repo.
priority()
359 <<
"\" />" << endl << endl;
362 for (LocaleSet::const_iterator iter = languages.begin(); iter != languages.end(); iter++) {
363 *
file <<
TAB <<
"<locale name=\"" << iter->code()
367 for_( it, modaliasList.begin(), modaliasList.end() ) {
372 for_( it, multiversionSpec.begin(), multiversionSpec.end() ) {
373 *
file <<
TAB <<
"<multiversion name=\"" << *it
381 :dumpFile (
"/var/log/YaST2/solverTestcase/solver-test.xml")
389 *
file <<
"</trial>" << endl
390 <<
"</test>" << endl;
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 <<
"\""
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 <<
"\""
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 <<
"\""
427 *
file <<
"<uninstall " <<
" kind=\"" <<
toLower (resObject->kind().asString()) <<
"\""
428 <<
" name=\"" << resObject->name() <<
"\""
429 <<
" status=\"" << status <<
"\""
435 for (CapabilitySet::const_iterator iter = capRequire.begin(); iter != capRequire.end(); iter++) {
436 *
file <<
"<addRequire " <<
" name=\"" << iter->asString() <<
"\"" <<
"/>" << endl;
438 for (CapabilitySet::const_iterator iter = capConflict.begin(); iter != capConflict.end(); iter++) {
439 *
file <<
"<addConflict " <<
" name=\"" << iter->asString() <<
"\"" <<
"/>" << endl;
445 for_( it, upgradeRepos_r.begin(), upgradeRepos_r.end() )
447 *
file <<
"<upgradeRepo name=\"" << it->alias() <<
"\"/>" << endl;
454 :dumpPath(
"/var/log/YaST2/solverTestcase")
468 if ( !path.isExist() ) {
470 ERR <<
"Cannot create directory " <<
dumpPath << endl;
497 HelixResolvable_Ptr system = NULL;
506 if ( system && it->status().isInstalled() ) {
508 system->addResolvable (*it);
511 Repository repo = it->resolvable()->satSolvable().repository();
513 if (repoTable.find (repo) == repoTable.end()) {
516 +
"-package.xml.gz");
518 repoTable[repo]->addResolvable (*it);
522 if ( it->status().isToBeInstalled()
523 && !(it->status().isBySolver())) {
524 items_to_install.push_back (*it);
526 if ( it->status().isKept()
527 && !(it->status().isBySolver())) {
528 items_keep.push_back (*it);
530 if ( it->status().isToBeUninstalled()
531 && !(it->status().isBySolver())) {
532 items_to_remove.push_back (*it);
534 if ( it->status().isLocked()
535 && !(it->status().isBySolver())) {
536 items_locked.push_back (*it);
547 "solver-system.xml.gz");
551 control.addTagIf(
"onlyRequires", resolver.
onlyRequires() );
552 control.addTagIf(
"forceResolve", resolver.
forceResolve() );
558 control.addTagIf(
"dupAllowDowngrade", resolver.dupAllowDowngrade() );
559 control.addTagIf(
"dupAllowNameChange", resolver.dupAllowNameChange() );
560 control.addTagIf(
"dupAllowArchChange", resolver.dupAllowArchChange() );
561 control.addTagIf(
"dupAllowVendorChange", resolver.dupAllowVendorChange() );
563 control.closeSetup();
566 for (PoolItemList::const_iterator iter = items_to_install.begin(); iter != items_to_install.end(); iter++) {
567 control.installResolvable (iter->resolvable(), iter->status());
570 for (PoolItemList::const_iterator iter = items_locked.begin(); iter != items_locked.end(); iter++) {
571 control.lockResolvable (iter->resolvable(), iter->status());
574 for (PoolItemList::const_iterator iter = items_keep.begin(); iter != items_keep.end(); iter++) {
575 control.keepResolvable (iter->resolvable(), iter->status());
578 for (PoolItemList::const_iterator iter = items_to_remove.begin(); iter != items_to_remove.end(); iter++) {
579 control.deleteResolvable (iter->resolvable(), iter->status());
static const epoch_t noepoch
Value representing noepoch.
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
bool isUpgradeMode() const
const std::set< Repository > & upgradeRepos() const
const_iterator begin() const
std::string alias() const
unique identifier for this source.
static const Dep RECOMMENDS
static const Dep SUPPLEMENTS
static const Dep CONFLICTS
bool ignoreAlreadyRecommended() const
Container of Capability (currently read only).
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
static ZConfig & instance()
Singleton ctor.
const std::string & asString() const
IdType id() const
Expert backdoor.
Enumeration class of dependency types.
Helper providing more detailed information about a Capability.
std::string release() const
Release.
void deleteResolvable(const ResObject::constPtr &resObject, const ResStatus &status)
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
void lockResolvable(const ResObject::constPtr &resObject, const ResStatus &status)
int clean_dir(const Pathname &path)
Like 'rm -r DIR/ *'.
What is known about a repository.
Access to the sat-pools string space.
std::list< PoolItem > PoolItemList
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
Exchange LineWriter for the lifetime of this object.
urls_const_iterator baseUrlsEnd() const
iterator that points at end of repository urls
const_iterator end() const
TraitsType::constPtrType constPtr
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
std::tr1::unordered_set< Capability > CapabilitySet
unsigned priority() const
Repository priority for solver.
bool isUpdateMode() const
void logfile(const Pathname &logfile_r)
Set path for the logfile.
std::string asString() const
Conversion to std::string
static LogControl instance()
Singleton access.
static const Dep SUGGESTS
const ModaliasList & modaliasList() const
List of modaliases found on system.
transform_iterator< repo::RepoVariablesUrlReplacer, url_set::const_iterator > urls_const_iterator
std::string xml_tag_enclose(const std::string &text, const std::string &tag, bool escape=false)
static const Dep ENHANCES
std::map< Repository, HelixResolvable_Ptr > RepositoryTable
A mid layer class we should remove.
ResObject::constPtr resolvable() const
Returns the ResObject::constPtr.
void addDependencies(const CapabilitySet &capRequire, const CapabilitySet &capConflict)
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
CapabilitySet extraRequires() const
CapDetail detail() const
Helper providing more detailed information about a Capability.
DEFINE_PTR_TYPE(HelixResolvable)
Common template to define ifgzstream/ofgzstream reading/writing gzip files.
std::string helixXML(const T &obj)
HelixResolvable(const std::string &path)
static const Dep REQUIRES
epoch_t epoch() const
Epoch.
void addResolvable(const PoolItem item)
std::string version() const
Version.
const LocaleSet & getRequestedLocales() const
Return the requested locales.
std::tr1::unordered_set< Locale > LocaleSet
void addUpgradeRepos(const std::set< Repository > &upgradeRepos_r)
bool allowVendorChange() const
bool cleandepsOnRemove() const
Base class for reference counted objects.
static const SystemCheck & instance()
Singleton.
Turn on excessive logging for the lifetime of this object.
static const Dep PROVIDES
std::string numstring(char n, int w=0)
bool isExpression() const
std::string toLower(const std::string &s)
Return lowercase version of s.
void keepResolvable(const ResObject::constPtr &resObject, const ResStatus &status)
bool isVerifyingMode() const
std::vector< std::string > ModaliasList
const std::string & asString() const
String representation of relational operator.
repo::RepoType type() const
Type of repository,.
TraitsType::constPtrType constPtr
const_iterator end() const
Iterator pointing behind the last Capability.
static Modalias & instance()
Singleton access.
Base class for Exception.
const std::set< std::string > & multiversionSpec() const
const std::string & asString() const
String representation of dependency type.
bool createTestcase(Resolver &resolver, bool dumpPool=true, bool runSolver=true)
std::string xml_escape(const std::string &text)
static const Dep OBSOLETES
CapabilitySet extraConflicts() const
gzstream_detail::fXstream< std::ostream, gzstream_detail::fgzstreambuf > ofgzstream
ostream writing gzip files.
IMPL_PTR_TYPE(ProblemSolutionCombi)
Creates a file in helix format which contains all controll action of a testcase ( file is known as *-...
void installResolvable(const ResObject::constPtr &resObject, const ResStatus &status)
Reference to a PoolItem connecting ResObject and ResStatus.
bool empty() const
Whether the string is empty.
pool::PoolTraits::const_iterator const_iterator
void addTagIf(const std::string &tag_r, bool yesno_r=true)
std::string asString() const
static const Dep PREREQUIRES
const_iterator begin() const
Iterator pointing to the first Capability.
bool onlyRequires() const
Creates a file in helix format which includes all available or installed packages,patches,selections....
Pathname path() const
Repository path.
sat::detail::IdType id() const
Expert backdoor.
detail::EscapedString escape(const std::string &in_r)
Escape xml special charaters (& -> &; from IoBind library).
bool forceResolve() const