Skip to content

Commit

Permalink
First config fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bzeller committed Oct 8, 2024
1 parent c7739ef commit 0be83f8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion zypp/ng/repo/workflows/rpmmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace zyppng::RpmmdWorkflows {
using ProvideRes = typename ProvideType::Res;

DlLogic( DlContextRefType ctx, MediaHandle &&mediaHandle, ProgressObserverRef &&progressObserver )
: zypp::repo::yum::RepomdFileCollector( ctx->destDir() )
: zypp::repo::yum::RepomdFileCollector( ctx->zyppContext(), ctx->destDir() )
, _ctx( std::move(ctx))
, _mediaHandle(std::move(mediaHandle))
, _progressObserver(std::move(progressObserver))
Expand Down
4 changes: 2 additions & 2 deletions zypp/repo/RepoMirrorList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace zypp
} // namespace
///////////////////////////////////////////////////////////////////

RepoMirrorList::RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r, bool mirrorListForceMetalink_r )
RepoMirrorList::RepoMirrorList( zyppng::ContextBaseRef ctx, const Url & url_r, const Pathname & metadatapath_r, bool mirrorListForceMetalink_r )
{
if ( url_r.getScheme() == "file" )
{
Expand All @@ -147,7 +147,7 @@ namespace zypp
cachefile /= "mirrorlist.txt";

zypp::filesystem::PathInfo cacheinfo( cachefile );
if ( !cacheinfo.isFile() || cacheinfo.mtime() < time(NULL) - (long) ZConfig::instance().repo_refresh_delay() * 60 )
if ( !cacheinfo.isFile() || cacheinfo.mtime() < time(NULL) - (long) ctx->config().repo_refresh_delay() * 60 )
{
DBG << "Getting MirrorList from URL: " << url_r << endl;
RepoMirrorListTempProvider provider( url_r ); // RAII: lifetime of downloaded file
Expand Down
7 changes: 4 additions & 3 deletions zypp/repo/RepoMirrorList.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <vector>
#include <zypp/Url.h>
#include <zypp/Pathname.h>
#include <zypp/ng/context.h>

namespace zypp
{
Expand All @@ -21,10 +22,10 @@ namespace zypp
class RepoMirrorList
{
public:
RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r, bool mirrorListForceMetalink_r );
RepoMirrorList( zyppng::ContextBaseRef ctx, const Url & url_r, const Pathname & metadatapath_r, bool mirrorListForceMetalink_r );

RepoMirrorList( const Url & url_r )
: RepoMirrorList( url_r, Pathname(), false )
RepoMirrorList( zyppng::ContextBaseRef ctx, const Url & url_r )
: RepoMirrorList( ctx, url_r, Pathname(), false )
{}

const std::vector<Url> & getUrls() const
Expand Down
7 changes: 4 additions & 3 deletions zypp/repo/yum/RepomdFileCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <zypp/ZConfig.h>
#include <zypp/PathInfo.h>
#include <zypp/ng/repoinfo.h>
#include <zypp/ng/context.h>
#include <solv/solvversion.h>

namespace zypp::env
Expand Down Expand Up @@ -89,11 +90,11 @@ namespace zypp::repo::yum
* Localized type:
* susedata.LOCALE
*/
RepomdFileCollector::RepomdFileCollector( const Pathname &destDir_r )
RepomdFileCollector::RepomdFileCollector( zyppng::ContextBaseRef ctx, const Pathname &destDir_r )
: _destDir { destDir_r }
{
addWantedLocale( ZConfig::instance().textLocale() );
for ( const Locale & it : ZConfig::instance().repoRefreshLocales() )
addWantedLocale( ctx->config().textLocale() );
for ( const Locale & it : ctx->config().repoRefreshLocales() )
addWantedLocale( it );
}

Expand Down
3 changes: 2 additions & 1 deletion zypp/repo/yum/RepomdFileCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef ZYPP_SOURCE_YUM_REPOMDFILECOLLECTOR
#define ZYPP_SOURCE_YUM_REPOMDFILECOLLECTOR

#include <zypp/ng/context_fwd.h>
#include <zypp-core/base/Easy.h>
#include <zypp-core/OnMediaLocation>
#include <zypp-core/Pathname.h>
Expand All @@ -32,7 +33,7 @@ namespace zypp::repo::yum

using FinalizeCb = std::function<void ( const OnMediaLocation &file )>;

RepomdFileCollector( const Pathname & destDir_r );
RepomdFileCollector( zyppng::ContextBaseRef ctx, const Pathname & destDir_r );
virtual ~RepomdFileCollector();

bool collect( const OnMediaLocation & loc_r, const std::string & typestr_r );
Expand Down
2 changes: 1 addition & 1 deletion zypp/target/rpm/RpmDb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ void RpmDb::doInstallPackage( const Pathname & filename, RpmInstFlags flags, Rpm
opts.push_back("--noglob");

// ZConfig defines cross-arch installation
if ( ! ZConfig::instance().systemArchitecture().compatibleWith( ZConfig::instance().defaultSystemArchitecture() ) )
if ( ! ZConfig::instance().systemArchitecture().compatibleWith( ZConfig::defaults().defaultSystemArchitecture() ) )
opts.push_back("--ignorearch");

if (flags & RPMINST_NODIGEST)
Expand Down

0 comments on commit 0be83f8

Please sign in to comment.