Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2015-04-27 22:07:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2015-04-10 09:45:10.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2015-04-27 22:07:14.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Apr 10 14:10:39 UTC 2015 - [email protected] + +- register addons from media (FATE#318505) +- 3.1.67 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.1.66.tar.bz2 New: ---- yast2-packager-3.1.67.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.OK7G4z/_old 2015-04-27 22:07:15.000000000 +0200 +++ /var/tmp/diff_new_pack.OK7G4z/_new 2015-04-27 22:07:15.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.66 +Version: 3.1.67 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -75,20 +75,12 @@ # ensure that 'checkmedia' is on the medium Recommends: checkmedia -Provides: yast2-config-package-manager -Obsoletes: yast2-config-package-manager -Provides: y2c_spkg -Provides: y2pkginf -Provides: y2t_inst-packages -Provides: y2t_spkg -Obsoletes: y2c_spkg -Obsoletes: y2pkginf -Obsoletes: y2t_inst-packages -Obsoletes: y2t_spkg -Provides: yast2-trans-inst-packages -Provides: yast2-trans-package-manager -Obsoletes: yast2-trans-inst-packages -Obsoletes: yast2-trans-package-manager +# for registering media add-ons on SLE +# (openSUSE does not contain the registration module) +%if 0%{?sles_version} +Recommends: yast2-registration +%endif + # force *-webpin subpackage removal at upgrade Obsoletes: yast2-packager-webpin < %version ++++++ yast2-packager-3.1.66.tar.bz2 -> yast2-packager-3.1.67.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.66/CONTRIBUTING.md new/yast2-packager-3.1.67/CONTRIBUTING.md --- old/yast2-packager-3.1.66/CONTRIBUTING.md 2015-04-08 15:14:55.000000000 +0200 +++ new/yast2-packager-3.1.67/CONTRIBUTING.md 2015-04-21 15:28:10.000000000 +0200 @@ -71,7 +71,7 @@ [widely used conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -If your commit is related to a bug in Buzgilla or an issue on GitHub, make sure +If your commit is related to a bug in Bugzilla or an issue on GitHub, make sure you mention it in the commit message for cross-reference. Use format like bnc#775814 or gh#yast/yast-foo#42. See also [GitHub autolinking](https://help.github.com/articles/github-flavored-markdown#references) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.66/package/yast2-packager.changes new/yast2-packager-3.1.67/package/yast2-packager.changes --- old/yast2-packager-3.1.66/package/yast2-packager.changes 2015-04-08 15:14:55.000000000 +0200 +++ new/yast2-packager-3.1.67/package/yast2-packager.changes 2015-04-21 15:28:10.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Apr 10 14:10:39 UTC 2015 - [email protected] + +- register addons from media (FATE#318505) +- 3.1.67 + +------------------------------------------------------------------- Mon Mar 16 09:45:04 UTC 2015 - [email protected] - Added reponame to license's title (bnc#899892) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.66/package/yast2-packager.spec new/yast2-packager-3.1.67/package/yast2-packager.spec --- old/yast2-packager-3.1.66/package/yast2-packager.spec 2015-04-08 15:14:55.000000000 +0200 +++ new/yast2-packager-3.1.67/package/yast2-packager.spec 2015-04-21 15:28:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.66 +Version: 3.1.67 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -74,12 +74,12 @@ # ensure that 'checkmedia' is on the medium Recommends: checkmedia -Provides: yast2-config-package-manager -Obsoletes: yast2-config-package-manager -Provides: y2t_spkg y2t_inst-packages y2pkginf y2c_spkg -Obsoletes: y2t_spkg y2t_inst-packages y2pkginf y2c_spkg -Provides: yast2-trans-package-manager yast2-trans-inst-packages -Obsoletes: yast2-trans-package-manager yast2-trans-inst-packages +# for registering media add-ons on SLE +# (openSUSE does not contain the registration module) +%if 0%{?sles_version} +Recommends: yast2-registration +%endif + # force *-webpin subpackage removal at upgrade Obsoletes: yast2-packager-webpin < %version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.66/src/modules/AddOnProduct.rb new/yast2-packager-3.1.67/src/modules/AddOnProduct.rb --- old/yast2-packager-3.1.66/src/modules/AddOnProduct.rb 2015-04-08 15:14:55.000000000 +0200 +++ new/yast2-packager-3.1.67/src/modules/AddOnProduct.rb 2015-04-21 15:28:10.000000000 +0200 @@ -44,6 +44,7 @@ Yast.import "URL" Yast.import "Stage" Yast.import "Icon" + Yast.import "Package" Yast.import "PackageCallbacks" Yast.import "PackagesProposal" Yast.import "SourceManager" @@ -885,9 +886,19 @@ # or check the content file if WorkflowManager.WorkflowRequiresRegistration(src_id) || Builtins.contains(@addons_requesting_registration, src_id) Builtins.y2milestone("Repository ID %1 requests registration", src_id) - # TODO FIXME: user needs to manually select the addon to register, - # pass the addon so it could be pre-selected - WFM.CallFunction("inst_scc", []) + + if !WFM.ClientExists("inst_scc") + package_installed = Package.Install("yast2-registration") + + if !package_installed + Report.Error(_("Package '%s' is not installed.\nThe add-on product cannot be registered.") % + "yast2-registration") + return nil + end + end + + # pass the addon so it could be registered + WFM.CallFunction("inst_scc", ["register_media_addon", src_id]) else Builtins.y2milestone( "Repository ID %1 doesn't need registration", @@ -1466,7 +1477,7 @@ one_prod ) Pkg.ResolvableInstall(one_prod, :product) - end + end # install all products from the destination else @@ -1657,7 +1668,7 @@ add_products = [] # new xml format if type == "xml" - add_products = ParseXMLBasedAddOnProductsFile(filename, base_url) + add_products = ParseXMLBasedAddOnProductsFile(filename, base_url) # old fallback elsif type == "plain" add_products = ParsePlainAddOnProductsFile(filename, base_url) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.66/test/addon_product_test.rb new/yast2-packager-3.1.67/test/addon_product_test.rb --- old/yast2-packager-3.1.66/test/addon_product_test.rb 2015-04-08 15:14:55.000000000 +0200 +++ new/yast2-packager-3.1.67/test/addon_product_test.rb 2015-04-21 15:28:10.000000000 +0200 @@ -32,4 +32,59 @@ end end + describe "#RegisterAddOnProduct" do + let(:repo_id) { 42 } + + context "the add-on requires registration" do + before do + allow(Yast::WorkflowManager).to receive(:WorkflowRequiresRegistration) + .with(repo_id).and_return(true) + end + + context "the registration client is installed" do + before do + expect(Yast::WFM).to receive(:ClientExists).with("inst_scc").and_return(true) + end + + it "starts the registration client" do + expect(Yast::WFM).to receive(:CallFunction).with("inst_scc", ["register_media_addon", repo_id]) + + Yast::AddOnProduct.RegisterAddOnProduct(repo_id) + end + end + + context "the registration client is not installed" do + before do + expect(Yast::WFM).to receive(:ClientExists).with("inst_scc").and_return(false) + end + + it "asks to install yast2-registration and starts registration if installed" do + expect(Yast::Package).to receive(:Install).with("yast2-registration").and_return(true) + expect(Yast::WFM).to receive(:CallFunction).with("inst_scc", ["register_media_addon", repo_id]) + + Yast::AddOnProduct.RegisterAddOnProduct(repo_id) + end + + it "asks to install yast2-registration and skips registration if not installed" do + expect(Yast::Package).to receive(:Install).with("yast2-registration").and_return(false) + expect(Yast::WFM).to_not receive(:CallFunction).with("inst_scc", ["register_media_addon", repo_id]) + + Yast::AddOnProduct.RegisterAddOnProduct(repo_id) + end + end + end + + context "the add-on does not require registration" do + before do + allow(Yast::WorkflowManager).to receive(:WorkflowRequiresRegistration) + .with(repo_id).and_return(false) + end + + it "add-on registration is skipped" do + expect(Yast::WFM).to_not receive(:CallFunction).with("inst_scc", ["register_media_addon", repo_id]) + + Yast::AddOnProduct.RegisterAddOnProduct(repo_id) + end + end + end end
