Skip to content

Commit

Permalink
Speed up finding the "autoyast()" supplements (bsc#1175317)
Browse files Browse the repository at this point in the history
- Filter the packages directly on the lilbzypp level
- Related to bsc#1146494
- Fixed unit test (do not change the current language)
- 4.3.37
  • Loading branch information
lslezak committed Aug 25, 2020
1 parent e381bed commit 43c3012
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions package/autoyast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Aug 25 07:33:20 UTC 2020 - Ladislav Slezák <[email protected]>

- Speed up finding the "autoyast()" supplements by filtering
packages directly on the lilbzypp level (bsc#1175317, related to
bsc#1146494)
- 4.3.37

-------------------------------------------------------------------
Mon Aug 24 13:44:00 CEST 2020 - [email protected]

Expand Down
6 changes: 3 additions & 3 deletions package/autoyast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.3.36
Version: 4.3.37
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down Expand Up @@ -130,8 +130,8 @@ Requires: yast2-transfer >= 2.21.0
# storage-ng based version
Requires: yast2-update >= 3.3.0
Requires: yast2-xml
# "transact_by" key in PkgPropertiesAll()
Requires: yast2-pkg-bindings >= 4.0.7
# RPM dependencies in Pkg.Resolvables
Requires: yast2-pkg-bindings >= 4.3.0
Requires: yast2-ruby-bindings >= 1.0.0

Provides: yast2-trans-autoinst
Expand Down
6 changes: 5 additions & 1 deletion src/lib/autoinstall/package_searcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ def evaluate_via_rpm
package_names = {}
log.info "Evaluating needed packages for handling AY-sections via RPM Supplements"
log.info "Sections: #{sections}"
packages = Y2Packager::Resolvable.find(kind: :package)
packages = Y2Packager::Resolvable.find(
kind: :package,
# this is a POSIX extended regexp, not a Ruby regexp!
supplements_regexp: "^autoyast\\(.*\\)"
)

sections.each do |section|
# Evaluting which package has the supplement autoyast(<section>)
Expand Down
4 changes: 4 additions & 0 deletions test/lib/clients/inst_autosetup_upgrade_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
allow(Yast::Pkg).to receive(:ResolvableInstall)
allow(Yast::Pkg).to receive(:ResolvableRemove)
allow(Yast::Pkg).to receive(:PkgSolve).and_return(true)
# do not change the current language, using translated messages
# would break test expectations
allow(Yast::WFM).to receive(:SetLanguage)
allow(Yast::UI).to receive(:SetLanguage)
end

describe "#main" do
Expand Down
3 changes: 2 additions & 1 deletion test/lib/package_searcher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@

before do
allow(Y2Packager::Resolvable).to receive(:find).with(
kind: :package
kind: :package,
supplements_regexp: "^autoyast\\(.*\\)"
).and_return(packages)
end

Expand Down

0 comments on commit 43c3012

Please sign in to comment.