Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11616 - in /trunk/libzypp: devel/devel.ma/Test.cc devel/devel.ma/ToolScanRepos.cc tests/sat/LookupAttr_test.cc zypp/sat/LookupAttr.cc zypp/sat/LookupAttr.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Fri, 07 Nov 2008 00:55:53 -0000
  • Message-id: <20081107005553.E372133962@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Fri Nov 7 01:55:53 2008
New Revision: 11616

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11616&view=rev
Log:
backup

Modified:
trunk/libzypp/devel/devel.ma/Test.cc
trunk/libzypp/devel/devel.ma/ToolScanRepos.cc
trunk/libzypp/tests/sat/LookupAttr_test.cc
trunk/libzypp/zypp/sat/LookupAttr.cc
trunk/libzypp/zypp/sat/LookupAttr.h

Modified: trunk/libzypp/devel/devel.ma/Test.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Test.cc?rev=11616&r1=11615&r2=11616&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Test.cc (original)
+++ trunk/libzypp/devel/devel.ma/Test.cc Fri Nov 7 01:55:53 2008
@@ -1,4 +1,5 @@
#include "Tools.h"
+#include <zypp/ResObjects.h>

/******************************************************************
**
@@ -10,11 +11,19 @@
INT << "===[START]==========================================" << endl;

// https://bugzilla.novell.com/show_bug.cgi?id=442200
-
Pathname mroot( "/tmp/ToolScanRepos" );
TestSetup test( mroot, Arch_x86_64 );
test.loadRepos();

+ ResPool pool( test.pool() );
+ for_( it, pool.byKindBegin<Patch>(), pool.byKindEnd<Patch>() )
+ {
+ Patch::constPtr p( (*it)->asKind<Patch>() );
+ MIL << p << endl;
+ Patch::Contents contents( p->contents() );
+ DBG << contents << endl;
+ }
+

INT << "===[END]============================================" << endl <<
endl;
return 0;

Modified: trunk/libzypp/devel/devel.ma/ToolScanRepos.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/ToolScanRepos.cc?rev=11616&r1=11615&r2=11616&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/ToolScanRepos.cc (original)
+++ trunk/libzypp/devel/devel.ma/ToolScanRepos.cc Fri Nov 7 01:55:53 2008
@@ -6,7 +6,7 @@
** FUNCTION TYPE : int
*/
int main( int argc, char * argv[] )
-{
+try {
INT << "===[START]==========================================" << endl;
std::string appname( Pathname::basename( argv[0] ) );
--argc;
@@ -43,4 +43,11 @@
INT << "===[END]============================================" << endl <<
endl;
return 0;
}
-
+catch ( const Exception & exp )
+{
+ INT;
+ cerr << exp << endl << exp.historyAsString();
+ throw;
+}
+catch (...)
+{}

Modified: trunk/libzypp/tests/sat/LookupAttr_test.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/sat/LookupAttr_test.cc?rev=11616&r1=11615&r2=11616&view=diff
==============================================================================
--- trunk/libzypp/tests/sat/LookupAttr_test.cc (original)
+++ trunk/libzypp/tests/sat/LookupAttr_test.cc Fri Nov 7 01:55:53 2008
@@ -3,7 +3,7 @@

#define LABELED(V) #V << ":\t" << V

-static TestSetup test( Arch_x86_64 );
+static TestSetup test( "/tmp/x", Arch_x86_64 );

// Must be the first test!
BOOST_AUTO_TEST_CASE(bnc_435838)
@@ -57,7 +57,20 @@

BOOST_AUTO_TEST_CASE(LookupAttr_)
{
-// base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter(
"/tmp/YLOG" ) );
-// sat::LookupAttr q( sat::SolvAttr::name );
-// MIL << "HI" << endl;
-}
\ No newline at end of file
+ base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "/tmp/YLOG"
) );
+ MIL << "GO" << endl;
+
+ sat::Pool satpool( test.satpool() );
+ for_( it, satpool.reposBegin(), satpool.reposEnd() )
+ {
+ SEC << endl;
+ sat::LookupAttr q( sat::SolvAttr::name, *it );
+ BOOST_CHECK_EQUAL( q.size(), it->solvablesSize() );
+ MIL << q << ' ' << q.size() << " in " << *it << endl;
+ DBG << q << endl;
+ }
+ return;
+ sat::LookupAttr q( sat::SolvAttr::name );
+ BOOST_CHECK_EQUAL( q.size(), satpool.solvablesSize() );
+ MIL << q << ' ' << q.size() << " in ALL" << endl;
+}

Modified: trunk/libzypp/zypp/sat/LookupAttr.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/LookupAttr.cc?rev=11616&r1=11615&r2=11616&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/LookupAttr.cc (original)
+++ trunk/libzypp/zypp/sat/LookupAttr.cc Fri Nov 7 01:55:53 2008
@@ -23,6 +23,12 @@

using std::endl;

+#if 0
+#undef XXX
+#define XXX MIL
+#warning Remove dummy debug output defines
+#endif
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
@@ -42,13 +48,20 @@
bool chain = false;

if ( _solv )
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(),
_solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
+ {
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(),
_solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
+ XXX << "Solv " << _solv << endl;
+ }
else if ( _repo )
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(),
_repo.id(), 0, _attr.id(), 0, 0 );
+ {
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(),
_repo.id(), 0, _attr.id(), 0, 0 );
+ XXX << "Repo " << _repo << endl;
+ }
else if ( ! sat::Pool::instance().reposEmpty() )
{
::dataiterator_init( dip.get(), sat::Pool::instance().get(),
sat::Pool::instance().reposBegin()->id(), 0, _attr.id(), 0, 0 );
chain = true;
+ XXX << "ALL " << endl;
}
else
return iterator();
@@ -99,6 +112,32 @@
// CLASS NAME : LookupAttr::iterator
//
///////////////////////////////////////////////////////////////////
+ std::ostream & operator<<( std::ostream & str, const ::_Dataiterator * obj
)
+ {
+
+ str << "::_Dataiterator(";
+ if ( ! obj )
+ {
+ str << "NULL";
+ }
+ else
+ {
+ str << '|' << obj->pool;
+ str << '|' << Repository(obj->repo);
+ str << '|' << obj->key;
+ str << '|' << obj->keyname;
+ str << '|' << obj->repodataid;
+ str << '|' << obj->solvid;
+ str << '|' << obj->repoid;
+ }
+ return str << ")";
+ }
+
+ std::ostream & operator<<( std::ostream & str, const scoped_ptr<
::_Dataiterator> & obj )
+ {
+ return str << obj.get();
+ }
+

///////////////////////////////////////////////////////////////////
// position and moving
@@ -345,7 +384,9 @@
, _chainRepos( chain_r )
{
_dip.swap( dip_r ); // take ownership!
+ XXX << _dip << endl;
increment();
+ XXX << *this << endl;
}

///////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/sat/LookupAttr.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/LookupAttr.h?rev=11616&r1=11615&r2=11616&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/LookupAttr.h (original)
+++ trunk/libzypp/zypp/sat/LookupAttr.h Fri Nov 7 01:55:53 2008
@@ -302,11 +302,11 @@
*/
iterator( scoped_ptr< ::_Dataiterator> & dip_r, bool chain_r );

- ::_Dataiterator * cloneFrom( const ::_Dataiterator * rhs );
-
private:
friend class boost::iterator_core_access;

+ ::_Dataiterator * cloneFrom( const ::_Dataiterator * rhs );
+
template <class OtherDerived, class OtherIterator, class V, class C,
class R, class D>
bool equal( const boost::iterator_adaptor<OtherDerived, OtherIterator,
V, C, R, D> & rhs ) const
{

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages