Author: mlandres
Date: Fri Feb 22 14:54:07 2008
New Revision: 8881
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8881&view=rev
Log:
Take care target uses --root when creating solv files (bnc #363789)
Modified:
trunk/libzypp/devel/devel.ma/NewPool.cc
trunk/libzypp/package/libzypp.changes
trunk/libzypp/zypp/target/TargetImpl.cc
Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=8881&r1=8880&r2=8881&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Fri Feb 22 14:54:07 2008
@@ -361,6 +361,8 @@
DBG << lhs << " <=> " << rhs << " --> " << ::strcmp( lhs, rhs ) << endl;
}
+namespace zypp
+{
namespace filter
{
template
@@ -383,8 +385,6 @@
{ return HasValue<_MemFun, _Value>( fun_r, val_r ); }
}
-namespace zypp
-{
}
template <class L>
@@ -422,50 +422,21 @@
namespace sat
{ /////////////////////////////////////////////////////////////////
- class ByLocaleSupport
- {
- private:
- typedef bool (sat::Solvable::*LS1) (const Locale &) const;
- typedef bool (sat::Solvable::*LS2) (const LocaleSet &) const;
-
- public:
- /** Solvables with locale support. */
- ByLocaleSupport()
- : _sel( mem_fun_ref( &sat::Solvable::supportsLocales ) )
- {}
-
- /** Solvables supporting \c locale_r. */
- ByLocaleSupport( const Locale & locale_r )
- : _sel( bind( mem_fun_ref( (LS1)&sat::Solvable::supportsLocale ), _1, locale_r ) )
- {}
-
- /** Solvables supporting at least one locale in \c locales_r. */
- ByLocaleSupport( const LocaleSet & locales_r )
- : _sel( bind( boost::mem_fun_ref( (LS2)&sat::Solvable::supportsLocale ), _1, locales_r ) )
- {}
-
- public:
- bool operator()( const sat::Solvable & solv_r ) const
- { return _sel && _sel( solv_r ); }
-
-
- template<class _Solv>
- bool operator()( const _Solv & solv_r ) const
- { return operator()( solv_r.satSolvable() ); }
-
- private:
- function _sel;
- };
-
/////////////////////////////////////////////////////////////////
} // namespace sat
///////////////////////////////////////////////////////////////////
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
/******************************************************************
**
@@ -522,7 +493,7 @@
}
}
- if ( 0 )
+ if ( 1 )
{
Measure x( "INIT TARGET" );
{
@@ -532,8 +503,17 @@
}
USR << "pool: " << pool << endl;
+
///////////////////////////////////////////////////////////////////
+ function _sel( bind( boost::mem_fun_ref( &sat::Solvable::isSystem ), _1 ) );
+ for_( it,
+ satpool.filterBegin( _sel ),
+ satpool.filterEnd ( _sel ) )
+ {
+ INT << *it << endl;
+ }
+
satpool.addRequestedLocale( Locale("de") );
satpool.addRequestedLocale( Locale("cs") );
@@ -544,7 +524,7 @@
{
Measure x( "de" );
- sat::ByLocaleSupport f( Locale("de") );
+ filter::ByLocaleSupport f( Locale("de") );
for_( it, satpool.filterBegin(f), satpool.filterEnd(f) )
{
MIL << *it << endl;
@@ -555,6 +535,8 @@
+
+
//MIL << sat::WhatProvides( Capability("amarok") ) << endl;
//MIL << sat::WhatProvides( Capability("amarok == 1.4.7-37.4") ) << endl;
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=8881&r1=8880&r2=8881&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Fri Feb 22 14:54:07 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Feb 22 14:03:59 CET 2008 - ma@suse.de
+
+- Take care target uses --root when creating solv files (bnc #363789)
+- revision 8881
+
+-------------------------------------------------------------------
Fri Feb 22 10:10:14 CET 2008 - schubi@suse.de
- Unmaintained packages which does not fit to the updated system
Modified: trunk/libzypp/zypp/target/TargetImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=8881&r1=8880&r2=8881&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/TargetImpl.cc (original)
+++ trunk/libzypp/zypp/target/TargetImpl.cc Fri Feb 22 14:54:07 2008
@@ -323,36 +323,36 @@
if ( build_rpm_solv )
{
+ // Take care we unlink the solvfile on exception
+ ManagedFile guard( rpmsolv, filesystem::unlink );
+ ManagedFile guardcookie( rpmsolvcookie, filesystem::unlink );
+
filesystem::TmpFile tmpsolv( Pathname::assertprefix( _root, ZConfig::instance().repoCachePath() ) /*dir*/,
- sat::Pool::instance().systemRepoName() /* prefix */);
+ sat::Pool::instance().systemRepoName() /* prefix */ );
MIL << "Executing solv converter" << endl;
-#warning FIXME add root to rpmdb2solv
- // FIXME add root to rpmdb2solv
- string cmd;
- if ( solvexisted )
- {
- MIL << "Old cache found, using it to speed up (merge)" << endl;
- cmd = str::form( "rpmdb2solv \"%s\" > \"%s\"", rpmsolv.c_str(), tmpsolv.path().c_str() );
- }
- else
- {
- cmd = str::form( "rpmdb2solv > \"%s\"", tmpsolv.path().c_str() );
- }
+ // FIXME add root to rpmdb2solv
+ ostringstream cmd;
+ cmd << "rpmdb2solv";
- ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
+ if ( ! _root.empty() )
+ cmd << " -r '" << _root << "'";
+
+ if ( solvexisted )
+ cmd << " '" << rpmsolv << "'";
+
+ cmd << " > '" << tmpsolv.path() << "'";
+
+ ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout );
for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) {
MIL << " " << output;
}
int ret = prog.close();
+
if ( ret != 0 )
ZYPP_THROW(Exception("Failed to cache rpm database"));
- // Take care we unlink the solvfile on exception
- ManagedFile guard( rpmsolv, filesystem::unlink );
- ManagedFile guardcookie( rpmsolvcookie, filesystem::unlink );
-
ret = filesystem::rename( tmpsolv, rpmsolv );
if ( ret != 0 )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org