return str.str();
}
-std::string helixXML( const Resolvable::constPtr &resolvable )
+std::string helixXML( const PoolItem_Ref &item )
{
+ const Resolvable::constPtr resolvable = item.resolvable();
stringstream str;
if ( isKind<SystemResObject>(resolvable)
|| isKind<Language>(resolvable) ) {
}
str << "<" << toLower (resolvable->kind().asString()) << ">" << endl;
- str << TAB << xml_tag_enclose (resolvable->name(), "name", true) << endl;
+ str << TAB << xml_tag_enclose (resolvable->name(), "name", true) << endl;
+ str << TAB << xml_tag_enclose (item->vendor(), "vendor", true) << endl;
if ( isKind<Package>(resolvable) ) {
str << TAB << "<history>" << endl << TAB << "<update>" << endl;
str << TAB2 << helixXML (resolvable->arch()) << endl;
RepositoryTable repoTable;
PoolItemList items_to_install;
PoolItemList items_to_remove;
- PoolItemList items_locked;
+ PoolItemList items_locked;
+ PoolItemList items_keep;
PoolItemList language;
HelixResolvable system (dumpPath + "/solver-system.xml");
} else {
if ( it->status().isInstalled() ) {
// system channel
- system.addResolvable (res);
+ system.addResolvable (*it);
} else {
// repo channels
ResObject::constPtr repoItem = it->resolvable();
+ numstring(repo.numericId())
+ "-package.xml");
}
- repoTable[repo]->addResolvable (res);
+ repoTable[repo]->addResolvable (*it);
}
if ( it->status().isToBeInstalled()
&& !(it->status().isBySolver())) {
items_to_install.push_back (*it);
}
+ if ( it->status().isKept()
+ && !(it->status().isBySolver())) {
+ items_keep.push_back (*it);
+ }
if ( it->status().isToBeUninstalled()
&& !(it->status().isBySolver())) {
items_to_remove.push_back (*it);
control.lockResolvable (iter->resolvable());
}
+ for (PoolItemList::const_iterator iter = items_keep.begin(); iter != items_keep.end(); iter++) {
+ control.keepResolvable (iter->resolvable());
+ }
for (PoolItemList::const_iterator iter = items_to_remove.begin(); iter != items_to_remove.end(); iter++) {
control.deleteResolvable (iter->resolvable());
}
-void HelixResolvable::addResolvable(const Resolvable::constPtr &resolvable)
+void HelixResolvable::addResolvable(const PoolItem_Ref item)
{
- *file << helixXML (resolvable);
+ *file << helixXML (item);
}
//---------------------------------------------------------------------------
<< "<!-- testcase generated by YaST -->" << endl
<< "<test>" << endl
<< "<setup arch=\"" << systemArchitecture << "\">" << endl
- << TAB << "<system file=\"" << systemPath << "\"/>" << endl;
+ << TAB << "<system file=\"" << systemPath << "\"/>" << endl << endl;
for ( RepositoryTable::const_iterator it = repoTable.begin();
it != repoTable.end(); ++it ) {
Repository repo = it->first;
+ *file << TAB << "<!-- " << endl
+ << TAB << "- alias : " << repo.info().alias() << endl;
+ for ( RepoInfo::urls_const_iterator itUrl = repo.info().baseUrlsBegin();
+ itUrl != repo.info().baseUrlsEnd();
+ ++itUrl )
+ {
+ *file << TAB << "- url : " << *itUrl << endl;
+ }
+ *file << TAB << "- path : " << repo.info().path() << endl;
+ *file << TAB << "- type : " << repo.info().type() << endl;
+ *file << TAB << " -->" << endl;
+
*file << TAB << "<channel file=\"" << numstring(repo.numericId())
<< "-package.xml\" name=\"" << numstring(repo.numericId())
- << "\" />" << endl;
+ << "\" />" << endl << endl;
}
for (PoolItemList::const_iterator iter = languages.begin(); iter != languages.end(); iter++) {
*file << TAB << "<locale name=\"" << iter->resolvable()->name()
<< " version=\"" << resObject->edition().version() << "\"" << " release=\"" << resObject->edition().release() << "\""
<< "/>" << endl;
}
+
+void HelixControl::keepResolvable(const ResObject::constPtr &resObject)
+{
+ Repository repo = resObject->repository();
+ *file << "<keep channel=\"" << numstring(repo.numericId()) << "\" kind=\"" << toLower (resObject->kind().asString()) << "\""
+ << " name=\"" << resObject->name() << "\"" << " arch=\"" << resObject->arch().asString() << "\""
+ << " version=\"" << resObject->edition().version() << "\"" << " release=\"" << resObject->edition().release() << "\""
+ << "/>" << endl;
+}
void HelixControl::deleteResolvable(const ResObject::constPtr &resObject)
{
#include "zypp/base/PtrTypes.h"
#include "zypp/solver/detail/Resolver.h"
#include "zypp/CapSet.h"
+#include "zypp/ResPool.h"
/////////////////////////////////////////////////////////////////////////
namespace zypp
std::string helixXML( const Dependencies &dep );
template<>
-std::string helixXML( const Resolvable::constPtr &resolvable );
+std::string helixXML( const PoolItem_Ref &item );
///////////////////////////////////////////////////////////////////
HelixResolvable (const std::string & path);
~HelixResolvable ();
- void addResolvable (const Resolvable::constPtr &resolvable);
+ void addResolvable (const PoolItem_Ref item);
std::string filename () { return dumpFile; }
};
~HelixControl ();
void installResolvable (const ResObject::constPtr &resObject);
- void lockResolvable (const ResObject::constPtr &resObject);
+ void lockResolvable (const ResObject::constPtr &resObject);
+ void keepResolvable (const ResObject::constPtr &resObject);
void deleteResolvable (const ResObject::constPtr &resObject);
void addDependencies (const CapSet &capRequire, const CapSet &capConflict);
std::string filename () { return dumpFile; }