Skip to content

Commit

Permalink
Merge db727e2 into d241b56
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 10, 2020
2 parents d241b56 + db727e2 commit ca9757e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
6 changes: 6 additions & 0 deletions package/yast2-add-on.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 10 14:04:00 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Reduce autoyast profile size if addons are empty (bsc#1172749)
- 4.3.1

-------------------------------------------------------------------
Thu May 7 08:58:18 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-add-on.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-add-on
Version: 4.3.0
Version: 4.3.1
Release: 0
Summary: YaST2 - Add-On media installation code
License: GPL-2.0-only
Expand Down
7 changes: 6 additions & 1 deletion src/lib/add-on/clients/add-on_auto.rb
Expand Up @@ -118,7 +118,12 @@ def change
end

def export
AddOnProduct.Export.merge(AddOnOthers.Export())
res = AddOnProduct.Export.merge(AddOnOthers.Export())

# cleaning of empty values
res.delete_if { |_k, v| v.empty? }

res
end

# Creates sources from add on products
Expand Down
23 changes: 21 additions & 2 deletions test/y2add_on/clients/add-on_auto_test.rb
Expand Up @@ -231,14 +231,33 @@
"media_url"=>"dvd:/?devices=/dev/sr1" }
]}
end
let(:add_on_others) { {"add_on_others"=>[]} }
let(:add_on_others) { {"add_on_others"=>[
{ "product_dir"=>"/Module-Desktop-Applications",
"product"=>"sle-module-desktop-applications",
"media_url"=>"dvd:/?devices=/dev/sr1" },

]} }

it "returns add-on products and other user defined add-ons" do
it "returns add-on products merged with other add-ons if they are non empty" do
expect(Yast::AddOnProduct).to receive(:Export).and_return(add_on_products)
expect(Yast::AddOnOthers).to receive(:Export).and_return(add_on_others)

expect(subject.export).to eq(add_on_products.merge(add_on_others))
end

it "returns just non empty type of addons" do
expect(Yast::AddOnProduct).to receive(:Export).and_return(add_on_products)
expect(Yast::AddOnOthers).to receive(:Export).and_return({})

expect(subject.export).to eq(add_on_products)
end

it "returns empty hash if all types are empty" do
expect(Yast::AddOnProduct).to receive(:Export).and_return({})
expect(Yast::AddOnOthers).to receive(:Export).and_return({})

expect(subject.export).to eq({})
end
end

describe "#write" do
Expand Down

0 comments on commit ca9757e

Please sign in to comment.