Skip to content

Commit

Permalink
Merge pull request #328 from yast/textdomain+ha_rename
Browse files Browse the repository at this point in the history
Missing textdomain, HA product merge
  • Loading branch information
lslezak committed Feb 27, 2018
2 parents cff84c9 + 45145e6 commit 6fea66c
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
9 changes: 9 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Feb 27 10:37:41 UTC 2018 - lslezak@suse.cz

- Added product merge: SLE11/12 HA GEO has been merged to SLE15 HA
(bsc#1069705)
- Added a missing textdomain in a file (bsc#1083015)
- Unified text domains to "packager"
- 4.0.44

-------------------------------------------------------------------
Tue Feb 27 08:36:20 UTC 2018 - lslezak@suse.cz

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


Name: yast2-packager
Version: 4.0.43
Version: 4.0.44
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2packager/clients/inst_product_upgrade_license.rb
Expand Up @@ -29,7 +29,7 @@ module Clients
# @see Y2Packager::Clients::InstProductLicense
class InstProductUpgradeLicense < InstProductLicense
def main
textdomain "installation"
textdomain "packager"

# do not display the license when going back, skip the dialog
return :back if Yast::GetInstArgs.going_back
Expand Down
Expand Up @@ -35,7 +35,7 @@ class InstRepositoriesInitialization

# Client main method
def main
textdomain "installation"
textdomain "packager"

if !init_installation_repositories
Yast::Popup.Error(
Expand Down
2 changes: 2 additions & 0 deletions src/lib/y2packager/widgets/license_translations_button.rb
Expand Up @@ -24,6 +24,8 @@ class LicenseTranslationsButton < CWM::PushButton

def initialize(product, language = nil)
super()
textdomain "packager"

@product = product
@language = language || Yast::Language.language
end
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2packager/widgets/simple_language_selection.rb
Expand Up @@ -37,7 +37,7 @@ class SimpleLanguageSelection < CWM::ComboBox
# @param languages [Array<String>] List of languages to display (en_US, de_DE, etc.)
# @param default [String] Default language code
def initialize(languages, default)
textdomain "y2packager"
textdomain "packager"
@languages = languages
@default = default
self.widget_id = "simple_language_selection"
Expand Down
6 changes: 5 additions & 1 deletion src/modules/AddOnProduct.rb
Expand Up @@ -15,8 +15,12 @@ class AddOnProductClass < Module
"SUSE_SLES" => ["SLES"],
# SLED or Workstation extension
"SUSE_SLED" => ["SLED", "sle-we"],
"sle-haegeo" => ["sle-ha-geo"],
# SLE11 HA has been renamed since SLE12
"sle-hae" => ["sle-ha"],
# SLE11 HA GEO is now included in SLE15 HA
"sle-haegeo" => ["sle-ha"],
# SLE12 HA GEO is now included in SLE15 HA
"sle-ha-geo" => ["sle-ha"],
"SUSE_SLES_SAP" => ["SLES_SAP"],
# SMT is now integrated into the base SLES
"sle-smt" => ["SLES"],
Expand Down
34 changes: 26 additions & 8 deletions test/packages_test.rb
Expand Up @@ -369,17 +369,35 @@ def product(properties = {})
end

it "returns updated product which has been renamed" do
products = [
{ "name" => "sle-haegeo", "status" => :removed },
{ "name" => "sle-ha-geo", "status" => :selected }
]
hae = { "name" => "sle-hae", "status" => :removed }
ha = { "name" => "sle-ha", "status" => :selected }
products = [hae, ha]

status = Yast::Packages.group_products_by_status(products)

expect(status[:updated].size).to eq(1)
old_product, new_product = status[:updated].first
expect(old_product["name"]).to eq("sle-haegeo")
expect(new_product["name"]).to eq("sle-ha-geo")
updates = status[:updated]
expect(updates.size).to eq(1)

# check the HAE => HA rename
expect(updates[hae]).to eq(ha)
end

it "returns updated products which have been merged" do
hae = { "name" => "sle-hae", "status" => :removed }
haegeo = { "name" => "sle-haegeo", "status" => :removed }
ha = { "name" => "sle-ha", "status" => :selected }
products = [hae, haegeo, ha]

status = Yast::Packages.group_products_by_status(products)

# product updates
updates = status[:updated]
expect(updates.size).to eq(2)

# check the HAE => HA rename
expect(updates[hae]).to eq(ha)
# check the HAE GEO => HA merge
expect(updates[haegeo]).to eq(ha)
end

it "handles mixed renamed and unchanged products" do
Expand Down

0 comments on commit 6fea66c

Please sign in to comment.