From baa4167c61e17150e580a7a3ecd3b49e51fcfa12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 17 Jun 2024 12:05:30 +0200 Subject: [PATCH] fix(service): Fixed libzypp repository cache removal --- service/lib/agama/software/manager.rb | 3 +++ service/test/agama/software/manager_test.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/service/lib/agama/software/manager.rb b/service/lib/agama/software/manager.rb index 4ca17754c2..4cdf82d899 100644 --- a/service/lib/agama/software/manager.rb +++ b/service/lib/agama/software/manager.rb @@ -510,6 +510,9 @@ def update_repositories(new_product) else # delete all, the #probe call will add the new repos repositories.delete_all + # deleting happens only in memory, to really delete the caches we need + # to write the repository setup to the disk + Yast::Pkg.SourceSaveAll end end end diff --git a/service/test/agama/software/manager_test.rb b/service/test/agama/software/manager_test.rb index 487492a50f..a7b9c61da3 100644 --- a/service/test/agama/software/manager_test.rb +++ b/service/test/agama/software/manager_test.rb @@ -83,6 +83,7 @@ before do allow(Yast::Pkg).to receive(:TargetInitialize) + allow(Yast::Pkg).to receive(:SourceSaveAll) allow(Yast::Pkg).to receive(:ImportGPGKey) # allow glob to work for other calls allow(Dir).to receive(:glob).and_call_original