Author: dmacvicar
Date: Sat Feb 2 23:26:20 2008
New Revision: 8448
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8448&view=rev
Log:
- port zypper to libzypp sat
Modified:
branches/tmp/ma/jump_sat/zypper/src/zypp-checkpatches.cc
branches/tmp/ma/jump_sat/zypper/src/zypper-info.cc
branches/tmp/ma/jump_sat/zypper/src/zypper-misc.cc
branches/tmp/ma/jump_sat/zypper/src/zypper-repos.cc
branches/tmp/ma/jump_sat/zypper/src/zypper-repos.h
branches/tmp/ma/jump_sat/zypper/src/zypper-search.cc
branches/tmp/ma/jump_sat/zypper/src/zypper-utils.cc
branches/tmp/ma/jump_sat/zypper/src/zypper.cc
Modified: branches/tmp/ma/jump_sat/zypper/src/zypp-checkpatches.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypp-checkpatches.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypp-checkpatches.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypp-checkpatches.cc Sat Feb 2 23:26:20 2008
@@ -17,7 +17,6 @@
#include
-#include "zypp/target/store/PersistentStorage.h"
#include "zypp/RepoManager.h"
#include "zypp/PathInfo.h"
@@ -29,7 +28,7 @@
#define XML_FORMAT_VERSION "0.4"
-using namespace zypp::detail;
+//using namespace zypp::detail;
using namespace std;
using namespace zypp;
@@ -227,7 +226,9 @@
for ( std::list<RepoInfo>::const_iterator it = repos.begin(); it != repos.end(); ++it )
{
Repository repository = manager.createFromCache(*it);
- God->addResolvables(repository.resolvables());
+ // FIXME fow now this will add repository resolvables
+ repository.resolvables();
+ //God->addResolvables();
}
if ( repos.size() == 0 )
@@ -235,9 +236,11 @@
errors.push_back( str::form( _( "There are no update repositories defined. Please add one or more update repositories in order to be notified of updates.") ) );
}
- God->addResolvables( God->target()->resolvables(), true);
+ God->target()->load();
+ //God->addResolvables( God->target()->resolvables(), true);
- God->resolver()->establishPool();
+ // FIXME no need to establish?
+ //God->resolver()->establishPool();
int count = 0;
int security_count = 0;
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-info.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-info.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-info.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-info.cc Sat Feb 2 23:26:20 2008
@@ -193,15 +193,17 @@
printSummaryDesc(pool_item.resolvable());
cout << _("Provides:") << endl;
- CapSet capSet = pool_item.resolvable()->dep(zypp::Dep::PROVIDES);
- for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
- cout << it->refers().asString() << ": " << it->asString() << endl;
+ Capabilities capSet = pool_item.resolvable()->dep(zypp::Dep::PROVIDES);
+ for (Capabilities::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
+ // FIXME cout << it->refers().asString() << ": " << it->asString() << endl;
+ cout << *it << endl;
}
cout << endl << _("Requires:") << endl;
capSet = pool_item.resolvable()->dep(zypp::Dep::REQUIRES);
- for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
- cout << it->refers().asString() << ": " << it->asString() << endl;
+ for (Capabilities::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
+ // FIXME cout << it->refers().asString() << ": " << it->asString() << endl;
+ cout << *it << endl;
}
}
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-misc.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-misc.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-misc.cc Sat Feb 2 23:26:20 2008
@@ -19,7 +19,7 @@
#include "zypp/RepoInfo.h"
-#include "zypp/CapFactory.h"
+//#include "zypp/CapFactory.h"
#include "zypp/target/store/xml_escape_parser.hpp"
@@ -30,7 +30,7 @@
#include "zypper-misc.h"
#include "zypper-callbacks.h"
-using namespace zypp::detail;
+//using namespace zypp::detail;
using namespace std;
using namespace zypp;
@@ -91,8 +91,8 @@
return ResTraits<Language>::kind;
if (lskind == "atom")
return ResTraits<Atom>::kind;
- if (lskind == "system")
- return ResTraits<SystemResObject>::kind;
+// if (lskind == "system")
+// return ResTraits<SystemResObject>::kind;
if (lskind == "srcpackage")
return ResTraits<SrcPackage>::kind;
// not recognized
@@ -258,8 +258,7 @@
}
}
}
-
- cap = CapFactory().parse (kind, new_capstr);
+ cap = Capability( new_capstr.c_str(), kind );
}
catch (const Exception& e) {
ZYPP_CAUGHT(e);
@@ -397,7 +396,7 @@
{
Capability cap = safe_parse_cap (zypper, kind, capstr);
- if (cap != Capability::noCap) {
+ if (cap.empty()) {
cout_vv << "Capability: " << cap << endl;
Resolver_Ptr resolver = zypp::getZYpp()->resolver();
@@ -436,18 +435,19 @@
DBG << "Removing user addRequire() addConflict()" << endl;
Resolver_Ptr solver = God->resolver();
- CapSet capSet = solver->getConflict();
- for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
- {
- DBG << "removing conflict: " << (*it) << endl;
- solver->removeConflict(*it);
- }
- capSet = solver->getRequire();
- for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
- {
- DBG << "removing require: " << (*it) << endl;
- solver->removeRequire(*it);
- }
+ // FIXME port this
+// CapSet capSet = solver->getConflict();
+// for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
+// {
+// DBG << "removing conflict: " << (*it) << endl;
+// solver->removeConflict(*it);
+// }
+// capSet = solver->getRequire();
+// for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
+// {
+// DBG << "removing require: " << (*it) << endl;
+// solver->removeRequire(*it);
+// }
MIL << "DONE" << endl;
}
@@ -884,7 +884,7 @@
int locks = God->applyLocks();
cout_v << format(_("%s items locked")) % locks << endl;
cout_v << _("Establishing status of aggregates") << endl;
- God->resolver()->establishPool();
+ //God->resolver()->establishPool();
dump_pool ();
}
@@ -1370,8 +1370,7 @@
// require anything greater than the installed version
try {
- Capability cap;
- cap = CapFactory().parse( installed->kind(), installed->name(), Rel::GT, installed->edition() );
+ Capability cap( installed->name(), Rel::GT, installed->edition(), installed->kind() );
resolver->addRequire( cap );
}
catch (const Exception& e) {
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-repos.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-repos.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-repos.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-repos.cc Sat Feb 2 23:26:20 2008
@@ -1214,7 +1214,7 @@
// ---------------------------------------------------------------------------
-void cond_load_resolvables(Zypper & zypper, bool to_pool)
+void cond_load_resolvables(Zypper & zypper)
{
static bool done = false;
// don't call this fuction more than once for a single ZYpp instance
@@ -1224,8 +1224,8 @@
MIL << "Going to load resolvables" << endl;
- load_repo_resolvables(zypper, to_pool);
- if (!zypper.globalOpts().disable_system_resolvables && to_pool)
+ load_repo_resolvables(zypper);
+ if (!zypper.globalOpts().disable_system_resolvables)
load_target_resolvables(zypper);
done = true;
@@ -1234,7 +1234,7 @@
// ---------------------------------------------------------------------------
-void load_repo_resolvables(Zypper & zypper, bool to_pool)
+void load_repo_resolvables(Zypper & zypper)
{
RepoManager manager(zypper.globalOpts().rm_options);
@@ -1276,11 +1276,6 @@
Repository repository(manager.createFromCache(repo));
ResStore store = repository.resolvables();
cout_v << " " << format(_("(%d resolvables found)")) % store.size() << endl;
-
- if (to_pool)
- God->addResolvables(store);
- else
- gData.repo_resolvables.insert(store.begin(), store.end());
}
catch (const Exception & e)
{
@@ -1296,25 +1291,25 @@
// ---------------------------------------------------------------------------
-void load_target_resolvables(Zypper & zypper, bool to_pool)
+void load_target_resolvables(Zypper & zypper)
{
if (!zypper.globalOpts().machine_readable)
cout_n << _("Reading RPM database...");
MIL << "Going to read RPM database" << endl;
- ResStore tgt_resolvables(God->target()->resolvables());
+ God->target()->load();
if (!zypper.globalOpts().machine_readable)
{
- cout_v << " " << format(_("(%s resolvables)")) % tgt_resolvables.size();
+ //cout_v << " " << format(_("(%s resolvables)")) % tgt_resolvables.size();
cout_n << endl;
}
- DBG << tgt_resolvables.size() << " resolvables read";
+ //DBG << tgt_resolvables.size() << " resolvables read";
- if (to_pool)
- God->addResolvables(tgt_resolvables, true /*installed*/);
- else
- gData.target_resolvables = tgt_resolvables;
+ //if (to_pool)
+ // God->addResolvables(tgt_resolvables, true /*installed*/);
+ //else
+ // gData.target_resolvables = tgt_resolvables;
}
// ---------------------------------------------------------------------------
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-repos.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-repos.h?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-repos.h (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-repos.h Sat Feb 2 23:26:20 2008
@@ -89,33 +89,22 @@
/**
* Load both repository and target resolvables.
- *
- * \param to_pool If <tt>true</tt>, the resolvables are added to the pool, if
- * <tt>false</tt> they will be stored in \ref gData.repo_resolvalbes
- * and \ref gData.target_resolvables (global ResStore vector).
- *
+ *
* \see load_repo_resolvables(bool)
* \see load_target_resolvables(bool)
*/
-void cond_load_resolvables(Zypper & zypper, bool to_pool = true);
+void cond_load_resolvables(Zypper & zypper);
/**
* Reads resolvables from the RPM database (installed resolvables) into the pool.
*
- * \param to_pool If <tt>true</tt>, the resolvables are added to the pool, if
- * <tt>false</tt> they will be stored \ref gData.target_resolvables
- * (global ResStore variable).
*/
-void load_target_resolvables(Zypper & zypper, bool to_pool = true);
+void load_target_resolvables(Zypper & zypper);
/**
- * Reads resolvables from the repository sqlite cache.
- *
- * \param to_pool If <tt>true</tt>, the resolvables are added to the pool, if
- * <tt>false</tt> they will be stored in \ref gData.repo_resolvables
- * (global ResStore vector).
+ * Reads resolvables from the repository solv cache.
*/
-void load_repo_resolvables(Zypper & zypper, bool to_pool = true);
+void load_repo_resolvables(Zypper & zypper);
/**
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-search.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-search.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-search.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-search.cc Sat Feb 2 23:26:20 2008
@@ -233,16 +233,17 @@
cout_v << _("Pre-caching installed resolvables matching given search criteria... ") << endl;
- ResStore tgt_resolvables(_zypp->target()->resolvables());
+ _zypp->target()->load();
+ //ResStore tgt_resolvables(_zypp->target()->resolvables());
- _zypp->addResolvables(tgt_resolvables, true /*installed*/);
+ //_zypp->addResolvables(tgt_resolvables, true /*installed*/);
invokeOnEachSearched( Match( _reg, _options.searchDescriptions()),
functorRef(_icache), functorRef(_icache)
);
- cout_v << _icache.size() << _(" out of (") << tgt_resolvables.size() << ")"
- << _("cached.") << endl;
+ //cout_v << _icache.size() << _(" out of (") << tgt_resolvables.size() << ")"
+ // << _("cached.") << endl;
}
/** PUBLIC
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper-utils.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper-utils.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper-utils.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper-utils.cc Sat Feb 2 23:26:20 2008
@@ -97,8 +97,8 @@
return _PL("language", "languages", count);
if (kind == ResTraits<Atom>::kind)
return _PL("atom", "atoms", count);
- if (kind == ResTraits<SystemResObject>::kind)
- return _PL("system", "systems", count);
+// if (kind == ResTraits<SystemResObject>::kind)
+// return _PL("system", "systems", count);
if (kind == ResTraits<SrcPackage>::kind)
return _PL("srcpackage", "srcpackages", count);
// default
Modified: branches/tmp/ma/jump_sat/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/zypper/src/zypper.cc?rev=8448&r1=8447&r2=8448&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/zypper/src/zypper.cc (original)
+++ branches/tmp/ma/jump_sat/zypper/src/zypper.cc Sat Feb 2 23:26:20 2008
@@ -44,7 +44,7 @@
using namespace std;
using namespace zypp;
-using namespace zypp::detail;
+//using namespace zypp::detail;
using namespace boost;
ZYpp::Ptr God = NULL;
@@ -1858,7 +1858,7 @@
cond_init_target(*this);
// load only repo resolvables, we don't need the installed ones
- load_repo_resolvables(*this, false /* don't load to pool */);
+ load_repo_resolvables(*this);
setExitCode(source_install(_arguments));
return;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org