Skip to content

Commit

Permalink
Merge branch 'SLE-12-SP2' into sle-12-sp2-casp-update-proposal
Browse files Browse the repository at this point in the history
* SLE-12-SP2:
  Install additional packages during upgrade (#222)
  • Loading branch information
imobachgs committed Jan 30, 2017
2 parents 5527657 + d413a36 commit f8db7b5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jan 30 10:57:14 UTC 2017 - igonzalezsosa@suse.com

- Packages module is able to perform a package selection proposal
during system upgrade (bsc#1009834)
- 3.1.119.4

-------------------------------------------------------------------
Tue Jan 24 13:15:46 UTC 2017 - jsrain@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 3.1.119.3
Version: 3.1.119.4
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
11 changes: 11 additions & 0 deletions src/modules/Packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,17 @@ def Proposal(force_reset, reinit, simple)
deep_copy(ret)
end

# Make a proposal for package selection during update
#
# As a side effect, it stores the current proposal.
#
# @see PackagesProposalChanged
def proposal_for_update
return unless PackagesProposalChanged()
@old_packages_proposal = PackagesProposal.GetAllResolvablesForAllTypes
Packages.SelectSystemPackages(false)
end

# Initialize the repositories with popup feedback
# Use Packages::Initialize (true) instead
def InitializeCatalogs
Expand Down
23 changes: 23 additions & 0 deletions test/packages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -993,4 +993,27 @@ def product(properties = {})
end
end

describe "#proposal_for_update" do
before do
allow(subject).to receive(:PackagesProposalChanged).and_return(changed)
end

context "when packages proposal was changed" do
let(:changed) { true }

it "selects system packages" do
expect(subject).to receive(:SelectSystemPackages).with(false)
subject.proposal_for_update
end
end

context "when packages proposal was not changed" do
let(:changed) { false }

it "does not select system packages" do
expect(subject).to_not receive(:SelectSystemPackages)
subject.proposal_for_update
end
end
end
end

0 comments on commit f8db7b5

Please sign in to comment.