\li \c ZYPP_LOGFILE=<PATH> Location of the logfile to write or \c - for stderr.
\li \c ZYPP_FULLLOG=1 Even more verbose logging (usually not needed).
-\li \c ZYPP_LIBSAT_FULLLOG=1 Verbose logging when resolving dependencies.
+\li \c ZYPP_LIBSOLV_FULLLOG=1 Verbose logging when resolving dependencies.
+\li \c (ZYPP_LIBSAT_FULLLOG=1) deprecated since \c libzypp-10.x, prefer \c ZYPP_LIBSOLV_FULLLOG
+
\li \c ZYPP_MEDIA_CURL_DEBUG=<0|1> Log http headers, if \c 1 also log server responses.
\subsection zypp-envars-mediabackend Selecting the mediabackend to use.
{
// map 'kind srcpackage' to 'arch src', the pseudo architecture
// libsolv uses.
- nid = ::rel2id( pool_r, nid, IdString(ARCH_SRC).id(), REL_ARCH, /*create*/true );
+ nid = ::pool_rel2id( pool_r, nid, IdString(ARCH_SRC).id(), REL_ARCH, /*create*/true );
}
// Extend name by architecture, if provided and not a srcpackage
if ( ! arch_r.empty() && kind_r != ResKind::srcpackage )
{
- nid = ::rel2id( pool_r, nid, arch_r.id(), REL_ARCH, /*create*/true );
+ nid = ::pool_rel2id( pool_r, nid, arch_r.id(), REL_ARCH, /*create*/true );
}
// Extend 'op edition', if provided
if ( op_r != Rel::ANY && ed_r != Edition::noedition )
{
- nid = ::rel2id( pool_r, nid, ed_r.id(), op_r.bits(), /*create*/true );
+ nid = ::pool_rel2id( pool_r, nid, ed_r.id(), op_r.bits(), /*create*/true );
}
return nid;
{}
const char * Capability::c_str() const
- { return( _id ? ::dep2str( myPool().getPool(), _id ) : "" ); }
+ { return( _id ? ::pool_dep2str( myPool().getPool(), _id ) : "" ); }
CapMatch Capability::_doMatch( sat::detail::IdType lhs, sat::detail::IdType rhs )
{
int Edition::_doCompare( const char * lhs, const char * rhs )
{
if ( lhs == rhs ) return 0;
- if ( lhs && rhs ) return ::evrcmp_str( myPool().getPool(), lhs, rhs, EVRCMP_COMPARE );
+ if ( lhs && rhs ) return ::pool_evrcmp_str( myPool().getPool(), lhs, rhs, EVRCMP_COMPARE );
return( lhs ? 1 : -1 );
}
int Edition::_doMatch( const char * lhs, const char * rhs )
{
if ( lhs == rhs ) return 0;
- if ( lhs && rhs ) return ::evrcmp_str( myPool().getPool(), lhs, rhs, EVRCMP_MATCH );
+ if ( lhs && rhs ) return ::pool_evrcmp_str( myPool().getPool(), lhs, rhs, EVRCMP_MATCH );
return( lhs ? 1 : -1 );
}
/////////////////////////////////////////////////////////////////
IdString::IdString( const char * str_r )
- : _id( ::str2id( myPool().getPool(), str_r, /*create*/true ) )
+ : _id( ::pool_str2id( myPool().getPool(), str_r, /*create*/true ) )
{}
IdString::IdString( const std::string & str_r )
- : _id( ::str2id( myPool().getPool(), str_r.c_str(), /*create*/true ) )
+ : _id( ::pool_str2id( myPool().getPool(), str_r.c_str(), /*create*/true ) )
{}
unsigned IdString::size() const
{ return ::strlen( c_str() ); }
const char * IdString::c_str() const
- { return _id ? ::id2str( myPool().getPool(), _id ) : ""; }
+ { return _id ? ::pool_id2str( myPool().getPool(), _id ) : ""; }
int IdString::compare( const IdString & rhs ) const
{
{
#include <sys/utsname.h>
#include <unistd.h>
-#include <solv/satversion.h>
+#include <solv/solvversion.h>
}
#include <iostream>
#include <fstream>
{
str << "libzypp: " << VERSION << " built " << __DATE__ << " " << __TIME__ << endl;
- str << "libsolv: " << sat_version;
- if ( ::strcmp( sat_version, LIBSOLV_VERSION_STRING ) )
+ str << "libsolv: " << solv_version;
+ if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
str << " (built against " << LIBSOLV_VERSION_STRING << ")";
str << endl;
*
*/
struct Transaction::Impl : protected detail::PoolMember
+ , private base::NonCopyable
{
friend std::ostream & operator<<( std::ostream & str, const Impl & obj );
public:
Impl()
- { memset( &_trans, 0, sizeof(_trans) ); }
+ : _trans( ::transaction_create( nullptr ) )
+ { memset( _trans, 0, sizeof(_trans) ); }
Impl( ::_Transaction & trans_r )
: _watcher( myPool().serial() )
+ , _trans( nullptr )
{
- memset( &_trans, 0, sizeof(_trans) );
- ::transaction_init( &_trans, myPool().getPool() );
-
Queue decisionq;
for_( it, ResPool::instance().begin(), ResPool::instance().end() )
{
}
if ( trans_r.noobsmap.size )
::map_grow( &trans_r.noobsmap, myPool()->nsolvables );
- ::transaction_calculate( &_trans, decisionq, &trans_r.noobsmap );
+ _trans = ::transaction_create_decisionq( myPool().getPool(), decisionq, &trans_r.noobsmap );
// NOTE: package/product buddies share the same ResStatus
// so we also link the buddies stepStages. This assumes
// only one buddy is acting during commit (package is installed,
// but no extra operation for the product).
- for_( it, _trans.steps.elements, _trans.steps.elements + _trans.steps.count )
+ for_( it, _trans->steps.elements, _trans->steps.elements + _trans->steps.count )
{
sat::Solvable solv( *it );
// buddy list:
}
~Impl()
- { ::transaction_free( &_trans ); }
+ { ::transaction_free( _trans ); }
public:
bool valid() const
// This is hwo we could implement out own order method.
// As ::transaction already groups by MediaNr, we don't
// need it for ORDER_BY_MEDIANR.
- ::transaction_order( &_trans, SOLVER_TRANSACTION_KEEP_ORDERDATA );
+ ::transaction_order( _trans, SOLVER_TRANSACTION_KEEP_ORDERDATA );
detail::IdType chosen = 0;
Queue choices;
while ( true )
{
- int ret = transaction_order_add_choices( &_trans, chosen, choices );
+ int ret = transaction_order_add_choices( _trans, chosen, choices );
MIL << ret << ": " << chosen << ": " << choices << endl;
chosen = choices.pop_front(); // pick one out of choices
if ( ! chosen )
#endif
if ( !_ordered )
{
- ::transaction_order( &_trans, 0 );
+ ::transaction_order( _trans, 0 );
_ordered = true;
}
return true;
}
bool empty() const
- { return( _trans.steps.count == 0 ); }
+ { return( _trans->steps.count == 0 ); }
size_t size() const
- { return _trans.steps.count; }
+ { return _trans->steps.count; }
const_iterator begin( const RW_pointer<Transaction::Impl> & self_r ) const
- { return const_iterator( self_r, _trans.steps.elements ); }
+ { return const_iterator( self_r, _trans->steps.elements ); }
iterator begin( const RW_pointer<Transaction::Impl> & self_r )
- { return iterator( self_r, _trans.steps.elements ); }
+ { return iterator( self_r, _trans->steps.elements ); }
const_iterator end( const RW_pointer<Transaction::Impl> & self_r ) const
- { return const_iterator( self_r, _trans.steps.elements + _trans.steps.count ); }
+ { return const_iterator( self_r, _trans->steps.elements + _trans->steps.count ); }
iterator end( const RW_pointer<Transaction::Impl> & self_r )
- { return iterator( self_r, _trans.steps.elements + _trans.steps.count ); }
+ { return iterator( self_r, _trans->steps.elements + _trans->steps.count ); }
const_iterator find(const RW_pointer<Transaction::Impl> & self_r, const sat::Solvable & solv_r ) const
{ detail::IdType * it( _find( solv_r ) ); return it ? const_iterator( self_r, it ) : end( self_r ); }
return isIn( _systemErase, solv_r.id() ) ? TRANSACTION_ERASE : TRANSACTION_IGNORE;
}
- switch( ::transaction_type( &_trans, solv_r.id(), SOLVER_TRANSACTION_RPM_ONLY ) )
+ switch( ::transaction_type( _trans, solv_r.id(), SOLVER_TRANSACTION_RPM_ONLY ) )
{
case SOLVER_TRANSACTION_ERASE: return TRANSACTION_ERASE; break;
case SOLVER_TRANSACTION_INSTALL: return TRANSACTION_INSTALL; break;
private:
detail::IdType * _find( const sat::Solvable & solv_r ) const
{
- if ( solv_r && _trans.steps.elements )
+ if ( solv_r && _trans->steps.elements )
{
- for_( it, _trans.steps.elements, _trans.steps.elements + _trans.steps.count )
+ for_( it, _trans->steps.elements, _trans->steps.elements + _trans->steps.count )
{
if ( *it == detail::IdType(solv_r.id()) )
return it;
private:
SerialNumberWatcher _watcher;
- mutable ::Transaction _trans;
+ mutable ::Transaction * _trans;
DefaultIntegral<bool,false> _ordered;
//
set_type _doneSet;
static void logSat( struct _Pool *, void *data, int type, const char *logString )
{
- if ( type & (SAT_FATAL|SAT_ERROR) ) {
+ if ( type & (SOLV_FATAL|SOLV_ERROR) ) {
_ERR("libsolv") << logString;
- } else if ( type & SAT_DEBUG_STATS ) {
+ } else if ( type & SOLV_DEBUG_STATS ) {
_DBG("libsolv") << logString;
} else {
_MIL("libsolv") << logString;
ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
}
// initialialize logging
- if ( getenv("ZYPP_LIBSAT_FULLLOG") )
+ if ( getenv("ZYPP_LIBSOLV_FULLLOG") || getenv("ZYPP_LIBSAT_FULLLOG") )
::pool_setdebuglevel( _pool, 4 );
else if ( getenv("ZYPP_FULLLOG") )
::pool_setdebuglevel( _pool, 2 );
else
- ::pool_setdebugmask(_pool, SAT_DEBUG_JOB|SAT_DEBUG_STATS);
+ ::pool_setdebugmask(_pool, SOLV_DEBUG_JOB|SOLV_DEBUG_STATS);
::pool_setdebugcallback( _pool, logSat, NULL );
{
if ( !_solv )
return sat::Transaction();
- return sat::Transaction( _solv->trans );
+
+ ::Transaction * sattrans = ::solver_create_transaction( _solv );
+ sat::Transaction ret ( *sattrans );
+ ::transaction_free( sattrans );
+ return ret;
}
ResPool
ERR << "Install: " << *iter << " not found" << endl;
} else {
MIL << "Install " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
queue_push( &(_jobQueue), id );
}
}
ERR << "Delete: " << *iter << " not found" << endl;
} else {
MIL << "Delete " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | MAYBE_CLEANDEPS );
+ queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | MAYBE_CLEANDEPS );
queue_push( &(_jobQueue), id);
}
}
ERR << "Install: " << *iter << " not found" << endl;
} else {
MIL << "Install " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
queue_push( &(_jobQueue), id );
}
}
ret = _("some dependency problem");
break;
case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
- ret = str::form (_("nothing provides requested %s"), dep2str(pool, dep));
+ ret = str::form (_("nothing provides requested %s"), pool_dep2str(pool, dep));
detail += _("Have you enabled all requested repositories?");
break;
case SOLVER_RULE_RPM_NOT_INSTALLABLE:
case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
ignoreId = source; // for setting weak dependencies
s = mapSolvable (source);
- ret = str::form (_("nothing provides %s needed by %s"), dep2str(pool, dep), s.asString().c_str());
+ ret = str::form (_("nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.asString().c_str());
break;
case SOLVER_RULE_RPM_SAME_NAME:
s = mapSolvable (source);
case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
s = mapSolvable (source);
s2 = mapSolvable (target);
- ret = str::form (_("%s conflicts with %s provided by %s"), s.asString().c_str(), dep2str(pool, dep), s2.asString().c_str());
+ ret = str::form (_("%s conflicts with %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
s = mapSolvable (source);
s2 = mapSolvable (target);
- ret = str::form (_("%s obsoletes %s provided by %s"), s.asString().c_str(), dep2str(pool, dep), s2.asString().c_str());
+ ret = str::form (_("%s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
s = mapSolvable (source);
s2 = mapSolvable (target);
- ret = str::form (_("installed %s obsoletes %s provided by %s"), s.asString().c_str(), dep2str(pool, dep), s2.asString().c_str());
+ ret = str::form (_("installed %s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
break;
case SOLVER_RULE_RPM_SELF_CONFLICT:
s = mapSolvable (source);
- ret = str::form (_("solvable %s conflicts with %s provided by itself"), s.asString().c_str(), dep2str(pool, dep));
+ ret = str::form (_("solvable %s conflicts with %s provided by itself"), s.asString().c_str(), pool_dep2str(pool, dep));
break;
case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
ignoreId = source; // for setting weak dependencies
}
}
- ret = str::form (_("%s requires %s, but this requirement cannot be provided"), s.asString().c_str(), dep2str(pool, dep));
+ ret = str::form (_("%s requires %s, but this requirement cannot be provided"), s.asString().c_str(), pool_dep2str(pool, dep));
if (providerlistInstalled.size() > 0) {
detail += _("deleted providers: ");
for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() );
resolverProblem->setDescription(_("This request will break your system!"));
description = _("ignore the warning of a broken system");
- description += string(" (requires:")+dep2str(pool, what)+")";
+ description += string(" (requires:")+pool_dep2str(pool, what)+")";
MIL << description << endl;
problemSolution->addFrontDescription (description);
} else {
- description = str::form (_("do not ask to install a solvable providing %s"), dep2str(pool, what));
+ description = str::form (_("do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
MIL << description << endl;
problemSolution->addDescription (description);
}
resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() );
resolverProblem->setDescription(_("This request will break your system!"));
description = _("ignore the warning of a broken system");
- description += string(" (conflicts:")+dep2str(pool, what)+")";
+ description += string(" (conflicts:")+pool_dep2str(pool, what)+")";
MIL << description << endl;
problemSolution->addFrontDescription (description);
} else {
- description = str::form (_("do not ask to delete all solvables providing %s"), dep2str(pool, what));
+ description = str::form (_("do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
MIL << description << endl;
problemSolution->addDescription (description);
}
if (itemFrom && itemTo) {
problemSolution->addSingleAction (itemTo, INSTALL);
- if (evrcmp(pool, s.get()->evr, sd.get()->evr, EVRCMP_COMPARE ) > 0)
+ if (pool_evrcmp(pool, s.get()->evr, sd.get()->evr, EVRCMP_COMPARE ) > 0)
{
string description = str::form (_("downgrade of %s to %s"), s.asString().c_str(), sd.asString().c_str());
MIL << description << endl;
sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
if (iter->status().isInstalled()) {
MIL << "Lock installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
queue_push( &(_jobQueue), ident );
} else {
MIL << "Lock NOT installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | MAYBE_CLEANDEPS );
+ queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | MAYBE_CLEANDEPS );
queue_push( &(_jobQueue), ident );
}
}
sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
if (iter->status().isInstalled()) {
MIL << "Keep installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
+ queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE | SOLVER_WEAK);
queue_push( &(_jobQueue), ident );
} else {
MIL << "Keep NOT installed item " << *iter << ident << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK | MAYBE_CLEANDEPS );
+ queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | SOLVER_WEAK | MAYBE_CLEANDEPS );
queue_push( &(_jobQueue), ident );
}
}
MIL << "Lock " << _item << " with the SAT-Pool ID: " << id << endl;
if (_item.status().isInstalled()) {
if (_soft) {
- queue_push( &(q), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK );
+ queue_push( &(q), SOLVER_INSTALL | SOLVER_SOLVABLE | SOLVER_WEAK );
} else {
- queue_push( &(q), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(q), SOLVER_INSTALL | SOLVER_SOLVABLE );
}
} else {
if (_soft) {
- queue_push( &(q), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK );
+ queue_push( &(q), SOLVER_ERASE | SOLVER_SOLVABLE | SOLVER_WEAK );
} else {
- queue_push( &(q), SOLVER_ERASE_SOLVABLE );
+ queue_push( &(q), SOLVER_ERASE | SOLVER_SOLVABLE );
}
}
queue_push( &(q), id );