Mailinglist Archive: zypp-commit (301 mails)

< Previous Next >
[zypp-commit] r7710 - in /branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma: Parse.cc Tools.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Tue, 30 Oct 2007 16:35:48 -0000
  • Message-id: <20071030163548.EBD6C3751C@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Oct 30 17:35:48 2007
New Revision: 7710

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

Modified:
branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Parse.cc
branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Tools.h

Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Parse.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Parse.cc?rev=7710&r1=7709&r2=7710&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Parse.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Parse.cc Tue Oct 30
17:35:48 2007
@@ -22,6 +22,7 @@
#include "zypp/NameKindProxy.h"
#include "zypp/pool/GetResolvablesToInsDel.h"

+#include "zypp/ZConfig.h"

using namespace std;
using namespace zypp;
@@ -30,7 +31,7 @@

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

-static const Pathname sysRoot( "/Local/ROOT" );
+static const Pathname sysRoot( "/Local/TEST" );

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

@@ -195,84 +196,41 @@
{
//zypp::base::LogControl::instance().logfile( "log.restrict" );
INT << "===[START]==========================================" << endl;
-
ConvertDbReceive cr;
cr.connect();
MediaChangeReceive mr;
mr.connect();

- ResPool pool( getZYpp()->pool() );
-
- getZYpp()->initTarget( sysRoot );
- USR << "Added target: " << pool << endl;
- zypp::base::LogControl::instance().logNothing();
+ USR << ZConfig::instance().download_use_patchrpm() << endl;
+ USR << ZConfig::instance().download_use_deltarpm() << endl;
return 0;

if ( 1 )
- {
- zypp::base::LogControl::TmpLineWriter shutUp;
- Source_Ref src( createSource( "dir:/Local/SLES10" ) );
- getZYpp()->addResolvables( src.resolvables() );
- }
- MIL << pool << endl;
-
- PoolItem prod( *pool.byKindBegin<Product>() );
- showProd( prod );
- PoolItem pac( *pool.byNameBegin("java-1_4_2-sun-plugin") );
-
- if ( 1 )
- {
- zypp::base::LogControl::TmpLineWriter shutUp;
- getZYpp()->initTarget( sysRoot );
- USR << "Added target: " << pool << endl;
- }
-
- prod.status().setTransact( true, ResStatus::USER );
- pac.status().setTransact( true, ResStatus::USER );
- ZYppCommitPolicy policy;
- policy.rpmNoSignature();
- ZYppCommitResult res( getZYpp()->commit( policy ) );
-
- SEC << res << endl;
-
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
-
+ {
+ zypp::base::LogControl::TmpLineWriter shutUp;
+ Source_Ref src( createSource(
"dir:/mounts/mirror/SuSE/ftp.suse.com/pub/suse/i386/update/10.2" ) );
+ getZYpp()->addResolvables( src.resolvables() );
+ }

if ( 1 )
- {
-#define selt(K,N) selectForTransact( nameKindProxy<K>( pool, #N ) )
- selt( Script, fetchmsttfonts.sh-patch-fetchmsttfonts.sh-2 );
-#undef selt
- }
-
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_begin<resfilter::ByTransact>(pool),
- make_filter_end<resfilter::ByTransact>(pool) ) << endl;
-
- if ( 1 ) {
- bool eres, rres;
- {
- //zypp::base::LogControl::TmpLineWriter shutUp;
- //zypp::base::LogControl::instance().logfile( "SOLVER" );
- eres = getZYpp()->resolver()->establishPool();
- rres = getZYpp()->resolver()->resolvePool();
- }
- MIL << "est " << eres << " slv " << rres << endl;
+ {
+ zypp::base::LogControl::TmpLineWriter shutUp;
+ getZYpp()->initTarget( sysRoot );
}

- dumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_begin<resfilter::ByTransact>(pool),
- make_filter_end<resfilter::ByTransact>(pool) ) << endl;
+ ResPool pool( getZYpp()->pool() );
+ MIL << pool << endl;

+ // zypper 0.6.15 0.1
+ PoolItem pi( getPi<Package>( "zypper", Edition( "0.6.15", "0.1" ) ) );
+ if ( pi )
+ {
+ pi.status().setTransactValue( ResStatus::TRANSACT, ResStatus::USER );
+ USR << pi << endl;
+ }

- if ( 1 )
- {
- ZYppCommitPolicy policy;
- policy.rpmNoSignature();
- ZYppCommitResult res( getZYpp()->commit( policy ) );
- }
+ USR << getZYpp()->commit( ZYppCommitPolicy().dryRun( true
).syncPoolAfterCommit( false ) ) << endl;
+ return true;

INT << "===[END]============================================" << endl <<
endl;
zypp::base::LogControl::instance().logNothing();

Modified: branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Tools.h
URL:
http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Tools.h?rev=7710&r1=7709&r2=7710&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Tools.h (original)
+++ branches/SuSE-SLE-10-SP2-Branch/libzypp/devel/devel.ma/Tools.h Tue Oct 30
17:35:48 2007
@@ -12,6 +12,10 @@
#include <zypp/ResObject.h>
#include <zypp/pool/PoolStats.h>

+#include <zypp/ZYppFactory.h>
+#include <zypp/ResPool.h>
+#include <zypp/ResPoolProxy.h>
+
#include <zypp/SourceFactory.h>
#include <zypp/source/susetags/SuseTagsImpl.h>

@@ -19,6 +23,8 @@
using zypp::debug::Measure;
using std::endl;

+#define for_(IT,BEG,END) for ( typeof(BEG) IT = BEG; IT != END; ++IT )
+
///////////////////////////////////////////////////////////////////
//

@@ -130,4 +136,56 @@
}
}

+///////////////////////////////////////////////////////////////////
+
+template<class _Res>
+ui::Selectable::Ptr getSel( const std::string & name_r )
+{
+ ResPoolProxy uipool( getZYpp()->poolProxy() );
+ for_(it, uipool.byKindBegin<_Res>(), uipool.byKindEnd<_Res>() )
+ {
+ if ( (*it)->name() == name_r )
+ return (*it);
+ }
+ return 0;
+}
+
+template<class _Res>
+PoolItem getPi( const std::string & name_r, const Edition & ed_r, const Arch &
arch_r )
+{
+ PoolItem ret;
+ ResPool pool( getZYpp()->pool() );
+ for_(it, pool.byNameBegin(name_r), pool.byNameEnd(name_r) )
+ {
+ if ( !ret && isKind<_Res>( (*it).resolvable() )
+ && ( ed_r == Edition() || ed_r == (*it)->edition() )
+ && ( arch_r == Arch() || arch_r == (*it)->arch() ) )
+ {
+ ret = (*it);
+ MIL << " ->" << *it << endl;
+ }
+ else
+ {
+ DBG << " ?" << *it << endl;
+ }
+ }
+ return ret;
+}
+template<class _Res>
+PoolItem getPi( const std::string & name_r )
+{
+ return getPi<_Res>( name_r, Edition(), Arch() );
+}
+template<class _Res>
+PoolItem getPi( const std::string & name_r, const Edition & ed_r )
+{
+ return getPi<_Res>( name_r, ed_r, Arch() );
+}
+template<class _Res>
+PoolItem getPi( const std::string & name_r, const Arch & arch_r )
+{
+ return getPi<_Res>( name_r, Edition(), arch_r );
+}
+///////////////////////////////////////////////////////////////////
+
#endif // Tools_h

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

< Previous Next >
This Thread
  • No further messages