From 7b9ad6c71abaae960434c897b4cda65f4b80d0b1 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:18:49 +0900 Subject: [PATCH] Imported Upstream version 17.10.2 --- VERSION.cmake | 4 +- libzypp.spec.cmake | 4 +- package/libzypp.changes | 11 +++ tests/data/TCNamespaceRecommends/solver-system.xml | 45 ++++++++++ tests/data/TCNamespaceRecommends/solver-test.xml | 13 +++ tests/data/TCNamespaceRecommends/update.xml | 75 +++++++++++++++++ tests/zypp/CMakeLists.txt | 1 + tests/zypp/Resolver_test.cc | 95 ++++++++++++++++++++++ zypp.conf | 6 +- zypp/CMakeLists.txt | 1 + zypp/RepoInfo.cc | 8 +- zypp/RepoManager.cc | 2 +- zypp/Resolver.cc | 4 - zypp/Resolver.h | 9 -- zypp/Target.h | 4 + zypp/base/Env.h | 78 ++++++++++++++++++ zypp/repo/Applydeltarpm.cc | 2 +- zypp/solver/detail/Resolver.cc | 4 - zypp/solver/detail/Resolver.h | 4 - zypp/solver/detail/SATResolver.cc | 23 ++---- zypp/solver/detail/SATResolver.h | 7 +- zypp/solver/detail/Testcase.cc | 8 -- zypp/target/TargetImpl.cc | 2 - zypp/zypp_detail/ZYppImpl.cc | 9 +- 24 files changed, 351 insertions(+), 68 deletions(-) create mode 100644 tests/data/TCNamespaceRecommends/solver-system.xml create mode 100644 tests/data/TCNamespaceRecommends/solver-test.xml create mode 100644 tests/data/TCNamespaceRecommends/update.xml create mode 100644 tests/zypp/Resolver_test.cc create mode 100644 zypp/base/Env.h diff --git a/VERSION.cmake b/VERSION.cmake index a2a8323..fb94ca5 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "17") SET(LIBZYPP_COMPATMINOR "9") SET(LIBZYPP_MINOR "10") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_PATCH "2") # -# LAST RELEASED: 17.10.1 (9) +# LAST RELEASED: 17.10.2 (9) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 6b5d903..e4d3b75 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -75,7 +75,7 @@ BuildRequires: pkgconfig BuildRequires: pkg-config %endif -BuildRequires: libsolv-devel >= 0.7.1 +BuildRequires: libsolv-devel >= 0.7.2 %if 0%{?suse_version} >= 1100 BuildRequires: libsolv-tools %requires_eq libsolv-tools @@ -363,7 +363,7 @@ fi %config(noreplace) %{_sysconfdir}/zypp/systemCheck %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr %dir %{_var}/lib/zypp -%dir %{_var}/log/zypp +%dir %attr(750,root,root) %{_var}/log/zypp %dir %{_var}/cache/zypp %{_prefix}/lib/zypp %{_datadir}/zypp diff --git a/package/libzypp.changes b/package/libzypp.changes index 9d513b1..24831b1 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Mon Dec 10 16:57:34 CET 2018 - ma@suse.de + +- commit: set `SYSTEMD_OFFLINE=1` during chrooted commits (bsc#1118758) +- no-recommends: Nevertheless consider resolver namespaces (hardware, + language,..supporting packages) (FATE#325513) +- BuildRequires: libsolv-devel >= 0.7.2 + (SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED) +- Remove world-readable bit from /var/log/zypp (bsc#1099019) +- version 17.10.2 (9) + +------------------------------------------------------------------- Wed Nov 28 14:40:26 CET 2018 - ma@suse.de - Adapt to changes in upcoming Boost 1.69.0 diff --git a/tests/data/TCNamespaceRecommends/solver-system.xml b/tests/data/TCNamespaceRecommends/solver-system.xml new file mode 100644 index 0000000..a208048 --- /dev/null +++ b/tests/data/TCNamespaceRecommends/solver-system.xml @@ -0,0 +1,45 @@ + + + + aspell + + + x86_64 + 00 + + + + + + + + + + aspell-en + + + x86_64 + 00 + + + + + + + + + + + + glibc + + + x86_64 + 00 + + + + + + + diff --git a/tests/data/TCNamespaceRecommends/solver-test.xml b/tests/data/TCNamespaceRecommends/solver-test.xml new file mode 100644 index 0000000..ddecaa5 --- /dev/null +++ b/tests/data/TCNamespaceRecommends/solver-test.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/tests/data/TCNamespaceRecommends/update.xml b/tests/data/TCNamespaceRecommends/update.xml new file mode 100644 index 0000000..59bd990 --- /dev/null +++ b/tests/data/TCNamespaceRecommends/update.xml @@ -0,0 +1,75 @@ + + + + aspell + + + x86_64 + 11 + + + + + + + + + + aspell-en + + + x86_64 + 11 + + + + + + + + + + + + aspell-de + + + x86_64 + 11 + + + + + + + + + + + + aspell-fr + + + x86_64 + 11 + + + + + + + + + + + + recommended-pkg + + + x86_64 + 11 + + + + + diff --git a/tests/zypp/CMakeLists.txt b/tests/zypp/CMakeLists.txt index 6649586..4612227 100644 --- a/tests/zypp/CMakeLists.txt +++ b/tests/zypp/CMakeLists.txt @@ -39,6 +39,7 @@ ADD_TESTS( RepoManager RepoStatus ResKind + Resolver ResStatus Selectable SetRelationMixin diff --git a/tests/zypp/Resolver_test.cc b/tests/zypp/Resolver_test.cc new file mode 100644 index 0000000..eca9c39 --- /dev/null +++ b/tests/zypp/Resolver_test.cc @@ -0,0 +1,95 @@ +#include +#define BOOST_CHECK_MODULE Resolver +using namespace boost::unit_test; + +#include "TestSetup.h" +#include "zypp/ResPool.h" +#include "zypp/ResPoolProxy.h" +#include "zypp/pool/PoolStats.h" +#include "zypp/ui/Selectable.h" + +static TestSetup test; + +struct BAD_TESTCASE {}; + +typedef std::set PoolItemSet; + +constexpr const unsigned onlyRequires = 0x1; +constexpr const unsigned inrMode = 0x2; + +PoolItemSet resolve( unsigned flags_r = 0 ) +{ + test.resolver().setOnlyRequires ( flags_r & onlyRequires ); + test.resolver().setIgnoreAlreadyRecommended( ! ( flags_r & inrMode ) ); + if ( ! test.resolver().resolvePool() ) + throw BAD_TESTCASE(); + + return { make_filter_begin(test.pool()), make_filter_end(test.pool()) }; +} + +inline PoolItem getPi( const std::string & name_r, bool installed_r ) +{ + for ( const auto & pi : test.pool().byName( name_r ) ) + { if ( pi.isSystem() == installed_r ) return pi; } + throw BAD_TESTCASE(); +} +inline PoolItem getIPi( const std::string & name_r ) +{ return getPi( name_r, true ); } +inline PoolItem getAPi( const std::string & name_r ) +{ return getPi( name_r, false ); } + +///////////////////////////////////////////////////////////////////////////// +// Pool content: +PoolItem Ip; // IA: aspell +PoolItem Ap; +PoolItem Ipen; // IA: aspell-en (wanted locale) +PoolItem Apen; +PoolItem Apde; // A: aspell-de (wanted locale) +PoolItem Apfr; // A: aspell-fr (unwanted locale) +PoolItem Aprec; // A: recommended-pkg (by aspell) + +BOOST_AUTO_TEST_CASE(testcase_init) +{ + test.loadTestcaseRepos( TESTS_SRC_DIR"/data/TCNamespaceRecommends" ); + Ip = getIPi( "aspell" ); + Ap = getAPi( "aspell" ); + Ipen = getIPi( "aspell-en" ); + Apen = getAPi( "aspell-en" ); + Apde = getAPi( "aspell-de" ); + Apfr = getAPi( "aspell-fr" ); + Aprec = getAPi( "recommended-pkg" ); +} + +///////////////////////////////////////////////////////////////////////////// + +inline void BOOST_checkresult( const PoolItemSet & resolved_r, const PoolItemSet & expected_r ) +{ BOOST_CHECK_EQUAL( resolved_r, expected_r ); } + + +BOOST_AUTO_TEST_CASE(install) +{ + Ap.status().setTransact( true, ResStatus::USER ); + // Upadte aspell, add all recommends + BOOST_checkresult( resolve(), { Ap, Ip, Apde, Aprec } ); + Ap.status().setTransact( false, ResStatus::USER ); +} + +BOOST_AUTO_TEST_CASE(installOnlyRequires) +{ + Ap.status().setTransact( true, ResStatus::USER ); + // Upadte aspell, add only namespace recommends + BOOST_checkresult( resolve( onlyRequires ), { Ap, Ip, Apde } ); + Ap.status().setTransact( false, ResStatus::USER ); +} + +BOOST_AUTO_TEST_CASE(inr) +{ + // Fillup all recommends + BOOST_checkresult( resolve( inrMode ), { Apde, Aprec } ); +} + +BOOST_AUTO_TEST_CASE(inrOnlyRequires) +{ + // Fillup only namespace recommends + BOOST_checkresult( resolve( inrMode|onlyRequires ), { Apde } ); +} diff --git a/zypp.conf b/zypp.conf index f09437a..14f64cd 100644 --- a/zypp.conf +++ b/zypp.conf @@ -344,9 +344,9 @@ ## -## Whether required packages are installed ONLY -## So recommended packages, language packages and packages which depend -## on hardware (modalias) will not be regarded. +## Whether only required packages are installed. +## +## Recommended packages, will not be regarded. ## ## Valid values: boolean ## Default value: false diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index 414af29..4249c7f 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -235,6 +235,7 @@ SET( zypp_base_HEADERS base/DrunkenBishop.h base/SerialNumber.h base/Easy.h + base/Env.h base/Errno.h base/Random.h base/Algorithm.h diff --git a/zypp/RepoInfo.cc b/zypp/RepoInfo.cc index 0a3575b..db230c7 100644 --- a/zypp/RepoInfo.cc +++ b/zypp/RepoInfo.cc @@ -387,11 +387,11 @@ namespace zypp bool RepoInfo::repoGpgCheck() const - { return gpgCheck() || _pimpl->cfgRepoGpgCheck(); } + { return gpgCheck() || bool(_pimpl->cfgRepoGpgCheck()); } bool RepoInfo::repoGpgCheckIsMandatory() const { - bool ret = ( gpgCheck() && indeterminate(_pimpl->cfgRepoGpgCheck()) ) || _pimpl->cfgRepoGpgCheck(); + bool ret = ( gpgCheck() && indeterminate(_pimpl->cfgRepoGpgCheck()) ) || bool(_pimpl->cfgRepoGpgCheck()); if ( ret && _pimpl->internalUnsignedConfirmed() ) // relax if unsigned repo was confirmed in the past ret = false; return ret; @@ -402,10 +402,10 @@ namespace zypp bool RepoInfo::pkgGpgCheck() const - { return _pimpl->cfgPkgGpgCheck() || ( gpgCheck() && !bool(validRepoSignature())/*enforced*/ ) ; } + { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && !bool(validRepoSignature())/*enforced*/ ) ; } bool RepoInfo::pkgGpgCheckIsMandatory() const - { return _pimpl->cfgPkgGpgCheck() || ( gpgCheck() && indeterminate(_pimpl->cfgPkgGpgCheck()) && !bool(validRepoSignature())/*enforced*/ ); } + { return bool(_pimpl->cfgPkgGpgCheck()) || ( gpgCheck() && indeterminate(_pimpl->cfgPkgGpgCheck()) && !bool(validRepoSignature())/*enforced*/ ); } void RepoInfo::setPkgGpgCheck( TriBool value_r ) { _pimpl->rawPkgGpgCheck( value_r ); } diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index dbcf7a1..ad53013 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -2243,7 +2243,7 @@ namespace zypp // Make sure the service repo is created with the appropriate enablement if ( ! indeterminate(toBeEnabled) ) - it->setEnabled( toBeEnabled ); + it->setEnabled( ( bool ) toBeEnabled ); DBG << "Service adds repo " << it->alias() << " " << (it->enabled()?"enabled":"disabled") << endl; addRepository( *it ); diff --git a/zypp/Resolver.cc b/zypp/Resolver.cc index 07f90d8..3625438 100644 --- a/zypp/Resolver.cc +++ b/zypp/Resolver.cc @@ -86,10 +86,6 @@ namespace zypp void Resolver::setIgnoreAlreadyRecommended( bool yesno_r) { _pimpl->setIgnoreAlreadyRecommended( yesno_r ); } bool Resolver::ignoreAlreadyRecommended() const { return _pimpl->ignoreAlreadyRecommended(); } - void Resolver::setInr( ResolverNamespaces namespaces_r ) { _pimpl->setInr( namespaces_r ); } - void Resolver::resetInr() { setInr( ResolverNamespaces() ); } - ResolverNamespaces Resolver::inr() const { return _pimpl->inr(); } - void Resolver::setOnlyRequires( bool yesno_r ) { _pimpl->setOnlyRequires( yesno_r ); } void Resolver::resetOnlyRequires() { _pimpl->setOnlyRequires( indeterminate ); } bool Resolver::onlyRequires() const { return _pimpl->onlyRequires(); } diff --git a/zypp/Resolver.h b/zypp/Resolver.h index 3225eb1..da7113a 100644 --- a/zypp/Resolver.h +++ b/zypp/Resolver.h @@ -189,15 +189,6 @@ namespace zypp bool ignoreAlreadyRecommended() const; /** - * Weak form of \ref ignoreAlreadyRecommended \c =false. - * Try to re-evaluate recommendations for specific namespaces only. - * \note May not support all namespaces. - */ - void setInr( ResolverNamespaces namespaces_r ); - void resetInr(); - ResolverNamespaces inr() const; - - /** * Setting whether required packages are installed ONLY * So recommended packages, language packages and packages which depend * on hardware (modalias) will not be regarded. diff --git a/zypp/Target.h b/zypp/Target.h index c13f449..1730c5c 100644 --- a/zypp/Target.h +++ b/zypp/Target.h @@ -93,6 +93,10 @@ namespace zypp /** Return the root set for this target */ Pathname root() const; + /** Whether the targets \ref root is not \c "/". */ + bool chrooted() const + { return( ! root().emptyOrRoot() ); } + /** Return the path prefixed by the target root, unless it already is prefixed. */ Pathname assertRootPrefix( const Pathname & path_r ) const { return Pathname::assertprefix( root(), path_r ); } diff --git a/zypp/base/Env.h b/zypp/base/Env.h new file mode 100644 index 0000000..5ff01d1 --- /dev/null +++ b/zypp/base/Env.h @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/base/Env.h + */ +#ifndef ZYPP_BASE_ENV_H +#define ZYPP_BASE_ENV_H + +#include +#include +#include + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ + /////////////////////////////////////////////////////////////////// + namespace env + { + /////////////////////////////////////////////////////////////////// + /// \class ScopedSet + /// \brief Temporarily set/unset an environment variable + /// \ingroup g_RAII + struct ScopedSet + { + ScopedSet( const ScopedSet & ) = delete; + ScopedSet & operator=( const ScopedSet & ) = delete; + + ScopedSet( ScopedSet && ) = default; + ScopedSet & operator=( ScopedSet && ) = default; + + public: + /** Default ctor (NOOP). */ + ScopedSet() + {} + + /** Set \a var_r to \a val_r (unsets \a var_r if \a val_r is a \c nullptr). */ + ScopedSet( std::string var_r, const char * val_r ) + : _var { std::move(var_r) } + { + if ( !_var.empty() ) + { + if ( const char * orig = ::getenv( _var.c_str() ) ) + _val.reset( new std::string( orig ) ); + setval( val_r ); + } + } + + /** Restore the original setting. */ + ~ScopedSet() + { + if ( !_var.empty() ) + setval( _val ? _val->c_str() : nullptr ); + } + + private: + void setval( const char * val_r ) + { + if ( val_r ) + ::setenv( _var.c_str(), val_r, 1 ); + else + ::unsetenv( _var.c_str() ); + } + + private: + std::string _var; + std::unique_ptr _val; + }; + + } // namespace env + /////////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZYPP_BASE_ENV_H diff --git a/zypp/repo/Applydeltarpm.cc b/zypp/repo/Applydeltarpm.cc index 7b382be..0a1b8ad 100644 --- a/zypp/repo/Applydeltarpm.cc +++ b/zypp/repo/Applydeltarpm.cc @@ -82,7 +82,7 @@ namespace zypp else WAR << "No executable " << prog << endl; } - return _last; + return ( bool ) _last; } /****************************************************************** diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc index 43d60d6..b34b438 100644 --- a/zypp/solver/detail/Resolver.cc +++ b/zypp/solver/detail/Resolver.cc @@ -76,7 +76,6 @@ std::ostream & Resolver::dumpOn( std::ostream & os ) const OUTS( _solveSrcPackages ); OUTS( _cleandepsOnRemove ); OUTS( _ignoreAlreadyRecommended ); - OUTS( _inr ); #undef OUT return os << ""; } @@ -95,8 +94,6 @@ Resolver::Resolver (const ResPool & pool) , _solveSrcPackages ( false ) , _cleandepsOnRemove ( ZConfig::instance().solver_cleandepsOnRemove() ) , _ignoreAlreadyRecommended ( true ) - // _inr defaults to ResolverNamespaces() - { sat::Pool satPool( sat::Pool::instance() ); _satResolver = new SATResolver(_pool, satPool.get()); @@ -311,7 +308,6 @@ void Resolver::solverInit() _satResolver->setFixsystem ( isVerifyingMode() ); _satResolver->setIgnorealreadyrecommended ( ignoreAlreadyRecommended() ); - _satResolver->setInr ( inr() ); _satResolver->setOnlyRequires ( onlyRequires() ); _satResolver->setUpdatesystem (_updateMode); _satResolver->setSolveSrcPackages ( solveSrcPackages() ); diff --git a/zypp/solver/detail/Resolver.h b/zypp/solver/detail/Resolver.h index 21a7006..e28626c 100644 --- a/zypp/solver/detail/Resolver.h +++ b/zypp/solver/detail/Resolver.h @@ -95,7 +95,6 @@ class Resolver : private base::NonCopyable bool _cleandepsOnRemove; // whether removing a package should also remove no longer needed requirements bool _ignoreAlreadyRecommended; //ignore recommended packages that have already been recommended by the installed packages - ResolverNamespaces _inr; // Try to re-evaluate recommendations for these namespaces //@} // Additional QueueItems which has to be regarded by the solver @@ -168,9 +167,6 @@ class Resolver : private base::NonCopyable bool ignoreAlreadyRecommended() const { return _ignoreAlreadyRecommended; } void setIgnoreAlreadyRecommended( bool yesno_r ) { _ignoreAlreadyRecommended = yesno_r; } - ResolverNamespaces inr() const { return _inr; } - void setInr( ResolverNamespaces namespaces_r ) { _inr = namespaces_r; } - bool onlyRequires () const { return _onlyRequires; } void setOnlyRequires( TriBool state_r ); diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc index 41e7214..260dd0c 100644 --- a/zypp/solver/detail/SATResolver.cc +++ b/zypp/solver/detail/SATResolver.cc @@ -170,7 +170,6 @@ SATResolver::dumpOn( std::ostream & os ) const os << " solveSrcPackages = " << _solveSrcPackages << endl; os << " cleandepsOnRemove = " << _cleandepsOnRemove << endl; os << " fixsystem = " << _fixsystem << endl; - os << " inr namespace = " << _inr << endl; } else { os << ""; } @@ -193,7 +192,7 @@ SATResolver::SATResolver (const ResPool & pool, sat::detail::CPool *satPool) , _updatesystem(false) , _noupdateprovide ( false ) , _dosplitprovides ( true ) - , _onlyRequires(ZConfig::instance().solver_onlyRequires()) + , _onlyRequires (ZConfig::instance().solver_onlyRequires()) , _ignorealreadyrecommended(true) , _distupgrade(false) , _distupgrade_removeunsupported(false) @@ -406,7 +405,8 @@ SATResolver::solving(const CapabilitySet & requires_caps, solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); - solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); + solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, false); // resolve recommended namespaces + solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires); // solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade ); solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange ); solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange ); @@ -625,19 +625,9 @@ SATResolver::solverInit(const PoolItemList & weakItems) } // Ad rules for changed requestedLocales - const auto & trackedLocaleIds( myPool().trackedLocaleIds() ); - if ( _inr.testFlag( ResolverNamespace::language ) ) - { - // inr mode - for ( const auto & locale : trackedLocaleIds.current() ) - { - queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES ); - queue_push( &(_jobQueue), Capability( ResolverNamespace::language, IdString(locale) ).id() ); - } - // TODO cleanup not requested locale packages? - } - else { + const auto & trackedLocaleIds( myPool().trackedLocaleIds() ); + // just track changed locakes for ( const auto & locale : trackedLocaleIds.added() ) { @@ -858,7 +848,8 @@ void SATResolver::doUpdate() solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); - solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); + solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, false); // resolve recommended namespaces + solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires); // sat::Pool::instance().prepare(); diff --git a/zypp/solver/detail/SATResolver.h b/zypp/solver/detail/SATResolver.h index c8e5435..3e70592 100644 --- a/zypp/solver/detail/SATResolver.h +++ b/zypp/solver/detail/SATResolver.h @@ -103,7 +103,7 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable, pr bool _updatesystem:1; // update bool _noupdateprovide:1; // true: update packages needs not to provide old package bool _dosplitprovides:1; // true: consider legacy split provides - bool _onlyRequires:1; // true: consider required packages only + bool _onlyRequires:1; // true: consider required packages only (but recommended namespaces) bool _ignorealreadyrecommended:1; // true: ignore recommended packages that were already recommended by the installed packages bool _distupgrade:1; bool _distupgrade_removeunsupported:1; @@ -115,8 +115,6 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable, pr bool _cleandepsOnRemove:1; // whether removing a package should also remove no longer needed requirements private: - ResolverNamespaces _inr; // Try to re-evaluate recommendations for these namespaces - private: // ---------------------------------- methods std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId); void resetItemTransaction (PoolItem item); @@ -178,9 +176,6 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable, pr bool ignorealreadyrecommended () const {return _ignorealreadyrecommended;} void setIgnorealreadyrecommended ( const bool ignorealreadyrecommended) { _ignorealreadyrecommended = ignorealreadyrecommended;} - ResolverNamespaces inr() const { return _inr; } - void setInr( ResolverNamespaces namespaces_r ) { _inr = namespaces_r; } - bool distupgrade () const {return _distupgrade;} void setDistupgrade ( const bool distupgrade) { _distupgrade = distupgrade;} diff --git a/zypp/solver/detail/Testcase.cc b/zypp/solver/detail/Testcase.cc index 55b3f21..cf34ba1 100644 --- a/zypp/solver/detail/Testcase.cc +++ b/zypp/solver/detail/Testcase.cc @@ -308,7 +308,6 @@ class HelixControl { void deleteResolvable( const PoolItem & pi_r ); void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict); void addUpgradeRepos( const std::set & upgradeRepos_r ); - void addInr( ResolverNamespaces namespaces_r ); std::string filename () { return dumpFile; } }; @@ -464,12 +463,6 @@ void HelixControl::addUpgradeRepos( const std::set & upgradeRepos_r } } -void HelixControl::addInr( ResolverNamespaces namespaces_r ) -{ - if ( namespaces_r ) - *file << "" << endl; -} - //--------------------------------------------------------------------------- Testcase::Testcase() @@ -601,7 +594,6 @@ bool Testcase::createTestcase(Resolver & resolver, bool dumpPool, bool runSolver control.addDependencies (SystemCheck::instance().requiredSystemCap(), SystemCheck::instance().conflictSystemCap()); control.addUpgradeRepos( resolver.upgradeRepos() ); - control.addInr( resolver.inr() ); control.addTagIf( "distupgrade", resolver.isUpgradeMode() ); control.addTagIf( "update", resolver.isUpdateMode() ); diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc index 605c9cb..dae16ab 100644 --- a/zypp/target/TargetImpl.cc +++ b/zypp/target/TargetImpl.cc @@ -1100,8 +1100,6 @@ namespace zypp return true; }); } - - INT << "Needreboot " << needrebootSpec << endl; satpool.setNeedrebootSpec( std::move(needrebootSpec) ); } diff --git a/zypp/zypp_detail/ZYppImpl.cc b/zypp/zypp_detail/ZYppImpl.cc index 3446014..56dd17e 100644 --- a/zypp/zypp_detail/ZYppImpl.cc +++ b/zypp/zypp_detail/ZYppImpl.cc @@ -14,6 +14,7 @@ #include "zypp/TmpPath.h" #include "zypp/base/Logger.h" #include "zypp/base/String.h" +#include "zypp/base/Env.h" #include "zypp/zypp_detail/ZYppImpl.h" #include "zypp/target/TargetImpl.h" @@ -147,8 +148,6 @@ namespace zypp * and target used for transact. */ ZYppCommitResult ZYppImpl::commit( const ZYppCommitPolicy & policy_r ) { - setenv( "ZYPP_IS_RUNNING", str::numstring(getpid()).c_str(), 1 ); - if ( getenv("ZYPP_TESTSUITE_FAKE_ARCH") ) { ZYPP_THROW( Exception("ZYPP_TESTSUITE_FAKE_ARCH set. Commit not allowed and disabled.") ); @@ -158,6 +157,12 @@ namespace zypp if (! _target) ZYPP_THROW( Exception("Target not initialized.") ); + + env::ScopedSet ea { "ZYPP_IS_RUNNING", str::numstring(getpid()).c_str() }; + env::ScopedSet eb; + if ( _target->chrooted() ) + eb = env::ScopedSet( "SYSTEMD_OFFLINE", "1" ); // bsc#1118758 - indicate no systemd if chrooted install + ZYppCommitResult res = _target->_pimpl->commit( pool(), policy_r ); if (! policy_r.dryRun() ) -- 2.7.4