Skip to content

Commit

Permalink
read release notes from media of manually added extension (bsc#957241)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsrain committed Dec 8, 2015
1 parent a765dd1 commit 8e5a05c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Dec 8 10:02:21 UTC 2015 - jsrain@suse.cz

- read release notes from media of manually added extension
(bsc#957241)

-------------------------------------------------------------------
Wed Nov 11 15:48:33 UTC 2015 - lslezak@suse.cz

Expand Down
27 changes: 27 additions & 0 deletions src/modules/AddOnProduct.rb
Expand Up @@ -49,6 +49,8 @@ def main
Yast.import "PackagesProposal"
Yast.import "SourceManager"

Yast.include self, "packager/load_release_notes.rb"

# variables for installation with product
# ID for cache in the inst-sys
@src_cache_id = -1
Expand Down Expand Up @@ -1146,6 +1148,28 @@ def HandleProductPATTERNS(srcid)
nil
end

def IntegrateReleaseNotes(repo_id)
products = Pkg.ResolvableProperties("", :product, ""). select do |product|
product["source"] = repo_id
end
product_name = products[0]["short_name"] || _("Unknown Product")
Builtins.y2milestone("Integrating release notes for product %1", product_name)

WFM.CallFunction("inst_download_release_notes")
# fallback - RN from media
if InstData.release_notes[product_name].nil?
Builtins.y2milestone("Getting on-line release notes failed, getting them from media")
if load_release_notes(repo_id)
# push button
Wizard.ShowReleaseNotesButton(_("Re&lease Notes..."), "rel_notes")
InstData.release_notes[product_name] = @media_text
UI::SetReleaseNotes(InstData.release_notes)
else
Builtins.y2error("Release notes not found on media.")
end
end
end

# Integrate the add-on product to the installation workflow, including
# preparations for 2nd stage and inst-sys update
# @param [Fixnum] srcid integer the ID of the repository
Expand Down Expand Up @@ -1174,6 +1198,9 @@ def Integrate(srcid)
# Adds workflow to the Workflow Store if any workflow exists
WorkflowManager.AddWorkflow(:addon, srcid, "")

# Adjust the release notes - display RN from add-ons during installation
IntegrateReleaseNotes(srcid) if Stage.initial

true
end

Expand Down

0 comments on commit 8e5a05c

Please sign in to comment.