Author: mlandres
Date: Thu Jul 19 17:11:57 2007
New Revision: 6107
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6107&view=rev
Log:
backup
Modified:
trunk/libzypp-testsuite/Makefile.am
trunk/libzypp-testsuite/configure.ac
trunk/libzypp-testsuite/solver/src/deptestomatic.cc
trunk/libzypp-testsuite/src/helix/HelixAtomImpl.cc
trunk/libzypp-testsuite/src/helix/HelixAtomImpl.h
trunk/libzypp-testsuite/src/helix/HelixMessageImpl.cc
trunk/libzypp-testsuite/src/helix/HelixMessageImpl.h
trunk/libzypp-testsuite/src/helix/HelixPackageImpl.cc
trunk/libzypp-testsuite/src/helix/HelixPackageImpl.h
trunk/libzypp-testsuite/src/helix/HelixPatchImpl.cc
trunk/libzypp-testsuite/src/helix/HelixPatchImpl.h
trunk/libzypp-testsuite/src/helix/HelixPatternImpl.cc
trunk/libzypp-testsuite/src/helix/HelixPatternImpl.h
trunk/libzypp-testsuite/src/helix/HelixProductImpl.cc
trunk/libzypp-testsuite/src/helix/HelixProductImpl.h
trunk/libzypp-testsuite/src/helix/HelixScriptImpl.cc
trunk/libzypp-testsuite/src/helix/HelixScriptImpl.h
trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.cc
trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.h
trunk/libzypp-testsuite/src/helix/HelixSourceImpl.cc
trunk/libzypp-testsuite/src/helix/HelixSourceImpl.h
trunk/libzypp-testsuite/target/tests/storagetargettest.cc
Modified: trunk/libzypp-testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/Makefile.am?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/Makefile.am (original)
+++ trunk/libzypp-testsuite/Makefile.am Thu Jul 19 17:11:57 2007
@@ -1,7 +1,8 @@
#
# Makefile.am for libzypp/testsuite
#
-SUBDIRS = src target solver source parser
+#SUBDIRS = src target solver source parser
+SUBDIRS = src solver
## ##################################################
Modified: trunk/libzypp-testsuite/configure.ac
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/configure.ac?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/configure.ac (original)
+++ trunk/libzypp-testsuite/configure.ac Thu Jul 19 17:11:57 2007
@@ -13,7 +13,7 @@
dnl ==================================================
-CXXFLAGS="${CXXFLAGS} -g -O3 -Wall -Wformat -Woverloaded-virtual"
+CXXFLAGS="${CXXFLAGS} -DFAKE -g -O3 -Wall -Wformat -Woverloaded-virtual"
AC_SYS_LARGEFILE
if test "$enable_largefile" != no ; then
enable_largefile=yes
Modified: trunk/libzypp-testsuite/solver/src/deptestomatic.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/solver/src/deptestomatic.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/solver/src/deptestomatic.cc (original)
+++ trunk/libzypp-testsuite/solver/src/deptestomatic.cc Thu Jul 19 17:11:57 2007
@@ -49,10 +49,10 @@
#include "zypp/ProblemSolution.h"
-#include "zypp/Source.h"
-#include "zypp/SourceFactory.h"
-#include "zypp/SourceManager.h"
-#include "zypp/source/SourceImpl.h"
+#include "zypp/Repository.h"
+//#include "zypp/SourceFactory.h"
+//#include "zypp/SourceManager.h"
+//#include "zypp/source/SourceImpl.h"
#include "zypp/base/String.h"
#include "zypp/base/Logger.h"
@@ -99,7 +99,7 @@
static ZYpp::LocaleSet locales;
static ZYpp::Ptr God;
-static SourceManager_Ptr manager;
+static RepoManager manager;
static bool forceResolve;
static int maxSolverPasses = 0;
@@ -114,6 +114,16 @@
#define MARKER ">!> "
#define RESULT cout << MARKER
+RepoManager makeRepoManager( const Pathname & mgrdir_r )
+{
+ RepoManagerOptions mgropt;
+
+ mgropt.repoCachePath = mgrdir_r/"cache";
+ mgropt.repoRawCachePath = mgrdir_r/"raw_cache";
+ mgropt.knownReposPath = mgrdir_r/"repos";
+
+ return RepoManager( mgropt );
+}
class compare_problems {
public:
@@ -130,7 +140,7 @@
if (show_mediaid) {
Resolvable::constPtr res = r;
Package::constPtr pkg = asKind<Package>(res);
- if (pkg) str << "[" << pkg->sourceMediaNr() << "]";
+ if (pkg) str << "[" << pkg->mediaNr() << "]";
}
if (r->kind() != ResTraitszypp::Package::kind)
str << r->kind() << ':';
@@ -138,13 +148,13 @@
if (r->arch() != "") {
str << '.' << r->arch();
}
- Source_Ref s = r->source();
+ Repository s = r->repository();
if (s) {
- string alias = s.alias();
+ string alias = s.info().alias();
if (!alias.empty()
&& alias != "@system")
{
- str << '[' << s.alias() << ']';
+ str << '[' << alias << ']';
}
// str << '[' << s << ']';
}
@@ -362,7 +372,7 @@
res = lhs->arch().compare( rhs->arch() );
if ( res )
return res < 0;
- res = lhs->source().alias().compare( rhs->source().alias() );
+ res = lhs->repository().info().alias().compare( rhs->repository().info().alias() );
if ( res )
return res < 0;
// no more criteria, still equal:
@@ -483,7 +493,7 @@
if (mediaorder) {
cout << endl;
RESULT << "Media Order:" << endl << endl;
-
+
Target::PoolItemList dellist;
Target::PoolItemList inslist;
Target::PoolItemList srclist;
@@ -491,7 +501,7 @@
dellist.swap(collect._toDelete);
inslist.swap(collect._toInstall);
srclist.swap(collect._toSrcinstall);
-
+
int count = 0;
for (Target::PoolItemList::const_iterator iter = dellist.begin(); iter != dellist.end(); iter++) {
cout << "DEL " << ++count << ".: "; printRes (cout, (*iter)); cout << endl;
@@ -518,16 +528,14 @@
struct FindPackage : public resfilter::ResObjectFilterFunctor
{
PoolItem_Ref poolItem;
- Source_Ref source;
Resolvable::Kind kind;
bool edition_set;
Edition edition;
bool arch_set;
Arch arch;
- FindPackage (Source_Ref s, Resolvable::Kind k, const string & v, const string & r, const string & a)
- : source (s)
- , kind (k)
+ FindPackage (Resolvable::Kind k, const string & v, const string & r, const string & a)
+ : kind (k)
, edition_set( !v.empty() )
, edition( v, r )
, arch_set( !a.empty() )
@@ -569,23 +577,13 @@
{
PoolItem_Ref poolItem;
Resolvable::Kind kind = string2kind (kind_name);
- Source_Ref source;
try {
- source = manager->findSource (source_alias);
- }
- catch (Exception & excpt_r) {
- ZYPP_CAUGHT (excpt_r);
- cerr << "Can't find source '" << source_alias << "'" << endl;
- return poolItem;
- }
-
- try {
- FindPackage info (source, kind, ver, rel, arch);
+ FindPackage info (kind, ver, rel, arch);
invokeOnEach( God->pool().byNameBegin( package_name ),
God->pool().byNameEnd( package_name ),
- functor::chain( resfilter::BySource(source), resfilter::ByKind (kind) ),
+ functor::chain( resfilter::ByRepository(source_alias), resfilter::ByKind (kind) ),
functor::functorRef (info) );
poolItem = info.poolItem;
@@ -768,20 +766,20 @@
zypp::solver::detail::ItemCapKindList select = resolver->installs(it->second);
for (zypp::solver::detail::ItemCapKindList::const_iterator iter = selectedBy.begin(); iter != selectedBy.end(); ++iter) {
if (iter == selectedBy.begin()) {
- cout << prefix << ++count << ": ";
+ cout << prefix << ++count << ": ";
cout << " will be selected by:" << endl;
}
- cout << prefix << ++count << ": ";
+ cout << prefix << ++count << ": ";
cout << " " << iter->item << endl;
}
for (zypp::solver::detail::ItemCapKindList::const_iterator iter = select.begin(); iter != select.end(); ++iter) {
if (iter == select.begin()) {
- cout << prefix << ++count << ": ";
+ cout << prefix << ++count << ": ";
cout << " will select:" << endl;
}
- cout << prefix << ++count << ": ";
+ cout << prefix << ++count << ": ";
cout << " " << iter->item << endl;
- }
+ }
}
}
cout << "Pool End." << endl;
@@ -792,7 +790,7 @@
void
set_licence_Pool()
{
-
+
SortItem info( true );
invokeOnEach( God->pool().begin( ),
God->pool().end ( ),
@@ -802,7 +800,7 @@
it->second.status().setLicenceConfirmed();
}
- return;
+ return;
}
static int
@@ -810,7 +808,7 @@
{
Pathname pathname = globalPath + filename;
int count = 0;
-
+#ifndef FAKE
Source_Ref src;
if (type == "url") {
@@ -866,8 +864,9 @@
count = -1;
}
- if(set_licence)
- set_licence_Pool();
+ if(set_licence)
+ set_licence_Pool();
+#endif
return count;
}
@@ -1032,7 +1031,7 @@
else {
MIL << "Setting architecture to '" << architecture << "'" << endl;
God->setArchitecture( Arch( architecture ) );
- setenv ("ZYPP_TESTSUITE_FAKE_ARCH", architecture.c_str(), 1);
+ setenv ("ZYPP_TESTSUITE_FAKE_ARCH", architecture.c_str(), 1);
}
} else if (node->equals ("locale")) {
string loc = node->getProp ("name");
@@ -1656,7 +1655,7 @@
string prefix = node->getProp ("prefix");
string all = node->getProp ("all");
string get_licence = node->getProp ("getlicence");
- string verbose = node->getProp ("verbose");
+ string verbose = node->getProp ("verbose");
print_pool( resolver, prefix, !all.empty(), get_licence, !verbose.empty() );
} else if (node->equals ("lock")) {
string source_alias = node->getProp ("channel");
@@ -2173,7 +2172,7 @@
string prefix = node->getProp ("prefix");
string all = node->getProp ("all");
string get_licence = node->getProp ("getlicence");
- string verbose = node->getProp ("verbose");
+ string verbose = node->getProp ("verbose");
print_pool( resolver, prefix, !all.empty(), get_licence, !verbose.empty() );
} else if (node->equals ("lock")) {
string source_alias = node->getProp ("channel");
@@ -2358,7 +2357,8 @@
zypp::base::LogControl::instance().logfile( "-" );
forceResolve = false;
- manager = SourceManager::sourceManager();
+
+ manager = makeRepoManager( "/tmp/myrepos" );
try {
God = zypp::getZYpp();
Modified: trunk/libzypp-testsuite/src/helix/HelixAtomImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixAtomImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixAtomImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixAtomImpl.cc Thu Jul 19 17:11:57 2007
@@ -35,7 +35,7 @@
}
Repository
-HelixAtomImpl::source() const
+HelixAtomImpl::repository() const
{ return _source; }
/////////////////////////////////////////////////////////////////
Modified: trunk/libzypp-testsuite/src/helix/HelixAtomImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixAtomImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixAtomImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixAtomImpl.h Thu Jul 19 17:11:57 2007
@@ -32,13 +32,13 @@
class HelixParser;
/** Default ctor
*/
- HelixAtomImpl( Source_Ref source_r, const zypp::HelixParser & data );
+ HelixAtomImpl( Repository source_r, const zypp::HelixParser & data );
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
protected:
- Source_Ref _source;
+ Repository _source;
};
Modified: trunk/libzypp-testsuite/src/helix/HelixMessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixMessageImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixMessageImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixMessageImpl.cc Thu Jul 19 17:11:57 2007
@@ -35,7 +35,7 @@
}
Repository
-HelixMessageImpl::source() const
+HelixMessageImpl::repository() const
{ return _source; }
TranslatedText
Modified: trunk/libzypp-testsuite/src/helix/HelixMessageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixMessageImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixMessageImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixMessageImpl.h Thu Jul 19 17:11:57 2007
@@ -38,7 +38,7 @@
std::string type () const;
virtual ByteCount size() const;
/** */
- virtual Repository source() const;
+ virtual Repository repository() const;
protected:
Repository _source;
Modified: trunk/libzypp-testsuite/src/helix/HelixPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPackageImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPackageImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPackageImpl.cc Thu Jul 19 17:11:57 2007
@@ -42,7 +42,7 @@
}
Repository
-HelixPackageImpl::source() const
+HelixPackageImpl::repository() const
{ return _source; }
/** Package summary */
Modified: trunk/libzypp-testsuite/src/helix/HelixPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPackageImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPackageImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPackageImpl.h Thu Jul 19 17:11:57 2007
@@ -48,7 +48,7 @@
/** */
virtual unsigned sourceMediaNr() const;
/** */
- virtual Repository source() const;
+ virtual Repository repository() const;
/** */
virtual Vendor vendor() const
Modified: trunk/libzypp-testsuite/src/helix/HelixPatchImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPatchImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPatchImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPatchImpl.cc Thu Jul 19 17:11:57 2007
@@ -29,14 +29,14 @@
/** Default ctor
*/
-HelixPatchImpl::HelixPatchImpl (Source_Ref source_r, const zypp::HelixParser & parsed)
+HelixPatchImpl::HelixPatchImpl (Repository source_r, const zypp::HelixParser & parsed)
: _source (source_r)
, _size_installed(parsed.installedSize)
{
}
-Source_Ref
-HelixPatchImpl::source() const
+Repository
+HelixPatchImpl::repository() const
{ return _source; }
ByteCount HelixPatchImpl::size() const
Modified: trunk/libzypp-testsuite/src/helix/HelixPatchImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPatchImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPatchImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPatchImpl.h Thu Jul 19 17:11:57 2007
@@ -32,7 +32,7 @@
class HelixParser;
/** Default ctor
*/
- HelixPatchImpl( Source_Ref source_r, const zypp::HelixParser & data );
+ HelixPatchImpl( Repository source_r, const zypp::HelixParser & data );
/** Patch ID */
@@ -50,10 +50,10 @@
/** The list of all atoms building the patch */
virtual AtomList all_atoms() const;
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
protected:
- Source_Ref _source;
+ Repository _source;
ByteCount _size_installed;
};
/////////////////////////////////////////////////////////////////
Modified: trunk/libzypp-testsuite/src/helix/HelixPatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPatternImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPatternImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPatternImpl.cc Thu Jul 19 17:11:57 2007
@@ -41,7 +41,7 @@
}
Repository
-HelixPatternImpl::source() const
+HelixPatternImpl::repository() const
{ return _source; }
/** Pattern summary */
Modified: trunk/libzypp-testsuite/src/helix/HelixPatternImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixPatternImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixPatternImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixPatternImpl.h Thu Jul 19 17:11:57 2007
@@ -25,14 +25,14 @@
//
/** Class representing a package
*/
-class HelixPatternImpl : public detail::Repository
+class HelixPatternImpl : public detail::PatternImplIf
{
public:
class HelixParser;
/** Default ctor
*/
- HelixPatternImpl( Source_Ref source_r, const zypp::HelixParser & data );
+ HelixPatternImpl( Repository source_r, const zypp::HelixParser & data );
/** Pattern summary */
virtual TranslatedText summary() const;
@@ -48,9 +48,9 @@
/** */
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
protected:
- Source_Ref _source;
+ Repository _source;
TranslatedText _summary;
TranslatedText _description;
PackageGroup _group;
Modified: trunk/libzypp-testsuite/src/helix/HelixProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixProductImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixProductImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixProductImpl.cc Thu Jul 19 17:11:57 2007
@@ -41,7 +41,7 @@
}
Repository
-HelixProductImpl::source() const
+HelixProductImpl::repository() const
{ return _source; }
/** Package summary */
Modified: trunk/libzypp-testsuite/src/helix/HelixProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixProductImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixProductImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixProductImpl.h Thu Jul 19 17:11:57 2007
@@ -48,7 +48,7 @@
/** */
/** */
- virtual Repository source() const;
+ virtual Repository repository() const;
protected:
Repository _source;
Modified: trunk/libzypp-testsuite/src/helix/HelixScriptImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixScriptImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixScriptImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixScriptImpl.cc Thu Jul 19 17:11:57 2007
@@ -36,7 +36,7 @@
}
Repository
-HelixScriptImpl::source() const
+HelixScriptImpl::repository() const
{ return _source; }
/** Get the script to perform the change */
Modified: trunk/libzypp-testsuite/src/helix/HelixScriptImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixScriptImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixScriptImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixScriptImpl.h Thu Jul 19 17:11:57 2007
@@ -32,7 +32,7 @@
class HelixParser;
/** Default ctor
*/
- HelixScriptImpl( Source_Ref source_r, const zypp::HelixParser & data );
+ HelixScriptImpl( Repository source_r, const zypp::HelixParser & data );
/** Get the script to perform the change */
virtual Pathname do_script() const;
@@ -44,10 +44,10 @@
virtual ByteCount size() const;
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
protected:
- Source_Ref _source;
+ Repository _source;
ByteCount _size_installed;
Modified: trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.cc Thu Jul 19 17:11:57 2007
@@ -37,7 +37,7 @@
}
Repository
-HelixSelectionImpl::source() const
+HelixSelectionImpl::repository() const
{ return _source; }
/** Selection summary */
Modified: trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixSelectionImpl.h Thu Jul 19 17:11:57 2007
@@ -32,7 +32,7 @@
class HelixParser;
/** Default ctor
*/
- HelixSelectionImpl( Source_Ref source_r, const zypp::HelixParser & data );
+ HelixSelectionImpl( Repository source_r, const zypp::HelixParser & data );
/** Selection summary */
virtual TranslatedText summary() const;
@@ -40,9 +40,9 @@
virtual TranslatedText description() const;
/** */
- virtual Source_Ref source() const;
+ virtual Repository repository() const;
protected:
- Source_Ref _source;
+ Repository _source;
TranslatedText _summary;
TranslatedText _description;
Modified: trunk/libzypp-testsuite/src/helix/HelixSourceImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixSourceImpl.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixSourceImpl.cc (original)
+++ trunk/libzypp-testsuite/src/helix/HelixSourceImpl.cc Thu Jul 19 17:11:57 2007
@@ -46,7 +46,7 @@
MIL << "HelixSourceImpl::HelixSourceImpl()" << endl;
}
-
+#if 0
void
HelixSourceImpl::factoryInit()
{
@@ -67,7 +67,6 @@
return;
}
-
void
HelixSourceImpl::factoryCtor( const media::MediaId & media_r, const Pathname & path_r, const std::string & alias_r, const Pathname cache_dir_r)
{
@@ -87,7 +86,7 @@
MIL << "HelixSourceImpl::createResolvables(" << _pathname << ", for source " << source.alias() << ")" << endl;
extractHelixFile (_pathname.asString(), this);
}
-
+#endif
//-----------------------------------------------------------------------------
Modified: trunk/libzypp-testsuite/src/helix/HelixSourceImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/src/helix/HelixSourceImpl.h?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/src/helix/HelixSourceImpl.h (original)
+++ trunk/libzypp-testsuite/src/helix/HelixSourceImpl.h Thu Jul 19 17:11:57 2007
@@ -38,57 +38,55 @@
#include "zypp/Product.h"
#include "zypp/Selection.h"
#include "zypp/Pattern.h"
+#include "zypp/media/MediaManager.h"
namespace zypp {
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : HelixSourceImpl
-class HelixSourceImpl : public zypp::repo::RepositoryImpl {
-
- public:
-
- /** Default ctor */
- HelixSourceImpl();
-
- private:
- /** Ctor substitute.
- * Actually get the metadata.
- * \throw EXCEPTION on fail
- */
- virtual void factoryInit();
+ class HelixSourceImpl : public zypp::repo::RepositoryImpl
+ {
-
- public:
- void factoryCtor( const media::MediaId & media_r,
- const Pathname & path_r = "/",
+ public:
+ /** Default ctor */
+ HelixSourceImpl();
+
+ private:
+ virtual void createResolvables();
+ virtual void createPatchAndDeltas();
+
+ public:
+ void parserCallback( const HelixParser & data );
+
+ private:
+ Dependencies createDependencies( const HelixParser & parsed );
+
+ Package::Ptr createPackage( const HelixParser & data );
+ Message::Ptr createMessage( const HelixParser & data );
+ Language::Ptr createLanguage( const HelixParser & data );
+ Script::Ptr createScript( const HelixParser & data );
+ Atom::Ptr createAtom( const HelixParser & data );
+ Patch::Ptr createPatch( const HelixParser & data );
+ Pattern::Ptr createPattern( const HelixParser & data );
+ Selection::Ptr createSelection( const HelixParser & data );
+ Product::Ptr createProduct( const HelixParser & data );
+
+ private:
+ Repository _source;
+
+#if 0
+ void factoryCtor( const media::MediaId & media_r,
+ const Pathname & path_r = "/",
const std::string & alias_r = "",
- const Pathname cache_dir_r = "");
-
- virtual const bool valid() const
- { return true; }
-
- Package::Ptr createPackage (const HelixParser & data);
- Message::Ptr createMessage (const HelixParser & data);
- Language::Ptr createLanguage (const HelixParser & data);
- Script::Ptr createScript (const HelixParser & data);
- Atom::Ptr createAtom (const HelixParser & data);
- Patch::Ptr createPatch (const HelixParser & data);
- Pattern::Ptr createPattern (const HelixParser & data);
- Selection::Ptr createSelection (const HelixParser & data);
- Product::Ptr createProduct (const HelixParser & data);
-
- Dependencies createDependencies (const HelixParser & data);
-
- void parserCallback (const HelixParser & data);
-
- private:
- Repository _source;
- Pathname _pathname;
- void createResolvables(Repository source_r);
+ const Pathname cache_dir_r = "");
-};
+ private:
+ Repository _source;
+ Pathname _pathname;
+#endif
+ };
} // namespace zypp
Modified: trunk/libzypp-testsuite/target/tests/storagetargettest.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/target/tests/storagetargettest.cc?rev=6107&r1=6106&r2=6107&view=diff
==============================================================================
--- trunk/libzypp-testsuite/target/tests/storagetargettest.cc (original)
+++ trunk/libzypp-testsuite/target/tests/storagetargettest.cc Thu Jul 19 17:11:57 2007
@@ -5,16 +5,12 @@
#include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp
#include "boost/filesystem/fstream.hpp" // ditto
-
#include
-#include "zypp/SourceFactory.h"
-
#include "zypp/base/Logger.h"
#include "zypp/base/Exception.h"
///////////////////////////////////////////////////////////////////
-#include "zypp/source/SourceInfo.h"
#include "zypp/target/store/PersistentStorage.h"
#include "zypp/target/store/XMLFilesBackend.h"
@@ -22,9 +18,10 @@
#include "zypp/base/Logger.h"
-#include "zypp/SourceFactory.h"
-#include "zypp/Source.h"
-#include "zypp/source/SourceImpl.h"
+//#include "zypp/SourceFactory.h"
+#include "zypp/Repository.h"
+//#include "zypp/source/SourceImpl.h"
+//#include "zypp/source/SourceInfo.h"
#include "zypp/PathInfo.h"
#include "zypp/ExternalProgram.h"
@@ -43,7 +40,7 @@
using namespace std;
using namespace zypp;
using namespace zypp::storage;
-using namespace zypp::source;
+//using namespace zypp::source;
using namespace boost::filesystem;
@@ -51,6 +48,23 @@
typedef std::listResObject::Ptr ResObjectPtrList;
+Repository repoCreateFrom( const Url & url_r,
+ const Pathname & path_r,
+ const std::string & alias_r )
+{
+#warning fixit
+ return Repository();
+}
+
+Repository repoCreateFrom( const Url & url_r,
+ const Pathname & path_r,
+ const std::string & alias_r,
+ const Pathname & cachedir_r )
+{
+#warning fixit
+ return Repository();
+}
+
static std::string dump( const CapSet &caps )
{
stringstream out;
@@ -81,10 +95,10 @@
struct StorageTargetTest
{
Pathname _root;
- Source_Ref _source;
+ Repository _source;
XMLFilesBackend *_backend;
ResStore _store;
-
+
StorageTargetTest(const Pathname &root)
{
_backend = 0L;
@@ -95,20 +109,20 @@
{
delete _backend;
}
-
+
void clean()
{
Pathname zyppvar = _root + "/var";
Pathname zyppcache = _root + "/source-cache";
-
+
if (zyppvar == "/var")
ZYPP_THROW(Exception("I refuse to delete /var"));
-
+
// filesystem::recursive_rmdir( zyppvar );
// filesystem::recursive_rmdir( zyppcache );
_store.clear();
}
-
+
void unpackDatabase(const Pathname &name)
{
const char *const argv[] = {
@@ -124,54 +138,48 @@
}
int ret = prog.close();
}
-
+
Pathname sourceCacheDir()
{
return _root + "/source-cache";
}
-
+
void initSourceWithCache(const Url &url)
{
- Url _url = url;
- SourceFactory source_factory;
- Pathname p = "/";
- _source = source_factory.createFrom( _url, p, "testsource", sourceCacheDir() );
+ _source = repoCreateFrom( url, "/", "testsource", sourceCacheDir() );
}
-
+
void initSource(const Url &url)
{
- Url _url = url;
- SourceFactory source_factory;
- Pathname p = "/";
- _source = source_factory.createFrom( _url, p, "testsource");
+ _source = repoCreateFrom( url, "/", "testsource");
}
-
+
void initStorageBackend()
{
_backend = new XMLFilesBackend(_root);
}
-
-
-
+
+
+
ResStore readSourceResolvables()
{
ResStore store;
store = _source.resolvables();
-
+
for (ResStore::const_iterator it = store.begin(); it != store.end(); it++)
_store.insert(*it);
-
- MIL << "done reading " << store.size() << " from source type " << _source.type() << ": Total resolvables now: " << _store.size() << std::endl;
+
+ MIL << "done reading " << store.size() << " from source type " << _source.info().type() << ": Total resolvables now: " << _store.size() << std::endl;
return store;
}
-
+
std::listResObject::Ptr readStoreResolvables()
{
std::listResObject::Ptr objs = _backend->storedObjects();
MIL << "Read " << objs.size() << " objects." << std::endl;
return objs;
}
-
+
void writeResolvablesInStore()
{
MIL << "Writing objects..." << std::endl;
@@ -181,12 +189,14 @@
_backend->storeObject(*it);
}
}
-
+
void storeSourceMetadata()
{
+#ifndef FAKE
_source.storeMetadata(sourceCacheDir());
+#endif
}
-
+
void storeKnownSources()
{
INT << "===[SOURCES]==========================================" << endl;
@@ -198,11 +208,11 @@
_backend->storeSource(data);
MIL << "Wrote 1 source" << std::endl;
}
-
+
//////////////////////////////////////////////////////////////
// TESTS
//////////////////////////////////////////////////////////////
-
+
int storage_read_test()
{
Benchmark b(__PRETTY_FUNCTION__);
@@ -217,19 +227,19 @@
if ( isKind<Selection>( res ) && res->name() == "Multimedia" )
{
// requires basis-sound and x11
- if ( res->deps()[Dep::REQUIRES].size() != 2 )
+ if ( res->deps()[Dep::REQUIRES].size() != 2 )
{
- ERR << dump( res->deps()[Dep::REQUIRES] ) ;
- ZYPP_THROW(Exception("Parsed of requires for Multimedia Selection failed."));
+ ERR << dump( res->deps()[Dep::REQUIRES] ) ;
+ ZYPP_THROW(Exception("Parsed of requires for Multimedia Selection failed."));
}
// provides multimedia and multimedia == version
if ( res->deps()[Dep::PROVIDES].size() != 2 )
- {
+ {
ERR << dump( res->deps()[Dep::PROVIDES] ) ;
- ZYPP_THROW(Exception("Parsed of provides for Multimedia Selection failed."));
+ ZYPP_THROW(Exception("Parsed of provides for Multimedia Selection failed."));
}
// recommends like 100 packages
- if ( res->deps()[Dep::RECOMMENDS].size() < 60 )
+ if ( res->deps()[Dep::RECOMMENDS].size() < 60 )
{
ERR << dump( res->deps()[Dep::RECOMMENDS] ) ;
ZYPP_THROW(Exception("Parsed of recommends for Multimedia Selection failed."));
@@ -239,7 +249,7 @@
clean();
return 0;
}
-
+
void read_known_sources_test()
{
clean();
@@ -248,9 +258,9 @@
source::SourceInfoList sources = _backend->storedSources();
MIL << "Read " << sources.size() << " sources" << std::endl;
if ( sources.size() != 2 )
- ZYPP_THROW(Exception("Known Sources read FAILED"));
- }
-
+ ZYPP_THROW(Exception("Known Sources read FAILED"));
+ }
+
int read_source_cache_test()
{
clean();
@@ -261,29 +271,29 @@
clean();
return 0;
}
-
+
int named_flags_test()
{
clean();
initStorageBackend();
-
+
_backend->setFlag("locks", "name=bleh");
_backend->setFlag("locks", "all except me");
-
+
std::setstd::string flags;
-
+
flags = _backend->flags("locks");
if (flags.size() != 2 )
ZYPP_THROW(Exception("wrote 2 flags, read != 2"));
-
+
_backend->removeFlag("locks", "all except me");
flags = _backend->flags("locks");
if (flags.size() != 1 )
ZYPP_THROW(Exception("wrote 2 flags, deleted 1, read != 1"));
-
+
return 0;
}
-
+
int publickey_test()
{
clean();
@@ -293,11 +303,11 @@
std::list<Pathname> keys = _source.publicKeys();
if (keys.size() != 4 )
ZYPP_THROW(Exception("Read wrong number of keys"));
-
+
clean();
return 0;
}
-
+
int sles10_machcd_source_read_test()
{
clean();
@@ -305,23 +315,23 @@
//initSourceWithCache(Url("ftp://10.10.0.5/CDs/SUSE-Linux-10.1-Build_803-Addon-BiArch/CD1"));
initSourceWithCache(Url("ftp://machcd2.suse.de/CDs/SLES-10-CD-i386-Build_1001/CD1"));
//initSource(Url("dir:/mounts/dist/10.0-i386"));
-
+
ResStore store = readSourceResolvables();
storeSourceMetadata();
return 0;
}
-
+
int quick_refresh_test()
{
//clean();
-
+
//initSourceWithCache(Url("ftp://you.suse.de/pub/suse/update/10.1"));
initSourceWithCache(Url("dir:/mounts/dist/install/stable-x86"));
-
+
storeSourceMetadata();
return 0;
}
-
+
int yumbug_read_test()
{
unpackDatabase("yum-createrepo-fixed.tar.gz");
@@ -330,15 +340,15 @@
dump(store);
return 0;
}
-
+
int huha_yum_patch_bug_read_test()
{
clean();
initStorageBackend();
- //initSource(Url("http://armstrong.suse.de/download/Code/10/update/i386/"));
+ //initSource(Url("http://armstrong.suse.de/download/Code/10/update/i386/"));
initSource(Url("ftp://machcd2.suse.de/CDs/SLES-10-CD-i386-Build_1001/CD1"));
ResStore store = readSourceResolvables();
-
+
for (ResStore::const_iterator it = _store.begin(); it != _store.end(); it++)
{
//DBG << **it << endl
@@ -358,15 +368,15 @@
}
return 0;
}
-
+
int download_rpm_checksum_test()
{
clean();
//initStorageBackend();
- initSource(Url("file:///mounts/machcd2/CDs/SLED-10-CD-i386-Beta9/CD1"));
+ initSource(Url("file:///mounts/machcd2/CDs/SLED-10-CD-i386-Beta9/CD1"));
//initSource(Url("http://ftp.chg.ru/pub/Linux/SuSE/suse/update/10.1"));
ResStore store = readSourceResolvables();
-
+
for (ResStore::const_iterator it = _store.begin(); it != _store.end(); it++)
{
//DBG << **it << endl
@@ -384,13 +394,13 @@
//readStoreResolvables();
return 0;
}
-
+
int agruenbacher_cap_test()
{
clean();
- initSource(Url("dir:/space/tmp"));
+ initSource(Url("dir:/space/tmp"));
ResStore store = readSourceResolvables();
-
+
//for (ResStore::const_iterator it = _store.begin(); it != _store.end(); it++)
//{
//ResObject::Ptr res = *it;
@@ -398,7 +408,7 @@
dump(store);
return 0;
}
-
+
//SUSE-Linux-10.1-beta6-x86_64-CD1
int sl_101_beta6_x86_64_source_read_test()
{
@@ -406,12 +416,12 @@
//initSource(Url("ftp://cml.suse.cz/netboot/find/SUSE-Linux-10.1-beta6-x86_64-CD1"));
unpackDatabase("SUSE-Linux-10.1-beta6-x86_64-source-metadata-cache.tar.gz");
initSourceWithCache(Url("dir:/fake-not-available-dir"));
-
+
ResStore store = readSourceResolvables();
clean();
return 0;
}
-
+
int armstrong_yum_source_source_read_test()
{
clean();
@@ -420,7 +430,7 @@
clean();
return 0;
}
-
+
int read_test()
{
MIL << "===[START: read_test()]==========================================" << endl;
@@ -442,9 +452,9 @@
//backend.setObjectFlag(*it, "blah1");
//backend.setObjectFlag(*it, "locked");
//backend.setObjectFlag(*it, "license-acepted");
-
+
}
-
+
for ( ResStore::const_iterator it = store.begin(); it != store.end(); it++)
{
std::setstd::string flags = backend.objectFlags(*it);
@@ -454,21 +464,21 @@
{
//ERR << "Tag " << *itf << std::endl;
}
-
+
//ERR << "Saved 3 tags, read " << flags.size() << " for " << **it << std::endl;
- //ZYPP_THROW(Exception("Saved 3 tags, read other"));
+ //ZYPP_THROW(Exception("Saved 3 tags, read other"));
}
}
*/
return 0;
}
-
+
int store_test()
{
MIL << "===[START: store_test()]==========================================" << endl;
- return 0;
+ return 0;
}
-
+
int parse_store_with_yum_test()
{
clean();
@@ -481,9 +491,9 @@
//break;
}
clean();
- return 0;
+ return 0;
}
-
+
};
#define TEST_FUNC_NAME(a) a##_test()
@@ -495,10 +505,10 @@
} while (false)
int main()
-{
+{
getZYpp()->initializeTarget("/");
try
- {
+ {
//RUN_TEST(armstrong_yum_source_source_read);
//RUN_TEST(huha_yum_patch_bug_read);
//RUN_TEST(yumbug_read);#
@@ -511,13 +521,13 @@
RUN_TEST(read_known_sources);
RUN_TEST(named_flags);
RUN_TEST(publickey);
-
+
//RUN_TEST(parse_store_with_yum);
RUN_TEST(sles10_machcd_source_read);
RUN_TEST(sl_101_beta6_x86_64_source_read);
-
+
//RUN_TEST(armstrong_yum_source_source_read);
-
+
MIL << "store testsuite passed" << std::endl;
*/
return 0;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org