Skip to content

Commit

Permalink
Merge pull request #84 from yast/products-supported
Browse files Browse the repository at this point in the history
Filter upgradable products in the partition selector already
  • Loading branch information
mvidner committed Nov 1, 2017
2 parents cab2845 + 19d029b commit 2138d51
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 31 deletions.
7 changes: 7 additions & 0 deletions package/yast2-update.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 31 14:51:13 UTC 2017 - mvidner@suse.com

- Filter upgradable products in the partition selector already
(FATE#323163).
- 4.0.0

-------------------------------------------------------------------
Tue Aug 22 10:59:42 UTC 2017 - knut.anderssen@suse.com

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


Name: yast2-update
Version: 3.3.4
Version: 4.0.0
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
46 changes: 16 additions & 30 deletions src/modules/RootPart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1938,63 +1938,49 @@ def CheckPartition(filesystem)
return deep_copy(freshman)
end

freshman[:valid] = false if !Update.IsProductSupportedForUpgrade

# Get installed release name
# TRANSLATORS: label for an unknown installed system
freshman[:name] = Update.installed_product || _("Unknown")
Builtins.y2debug("release: %1", freshman[:name])

# Right architecture?
Ops.set(
freshman,
:arch,
GetArchOfELF(Ops.add(Installation.destdir, "/bin/bash"))
)
freshman[:arch] = GetArchOfELF(Installation.destdir + "/bin/bash")
instsys_arch = GetArchOfELF("/bin/bash")

# `arch_valid, see bugzilla #288201
# installed /bin/bash and the one from inst-sys are matching
if Ops.get_string(freshman, :arch, "unknown") == instsys_arch
if freshman[:arch] == instsys_arch
Builtins.y2milestone("Architecture (%1) is valid", instsys_arch)
Ops.set(freshman, :arch_valid, true)
freshman[:arch_valid] = true

# both are PPC, bugzilla #249791
elsif Builtins.contains(
["ppc", "ppc64"],
Ops.get_string(freshman, :arch, "unknown")
) &&
Builtins.contains(["ppc", "ppc64"], instsys_arch)
elsif ["ppc", "ppc64"].include?(freshman[:arch]) &&
["ppc", "ppc64"].include?(instsys_arch)
Builtins.y2milestone(
"Architecture for partition %1 is %2, upgrading %3",
p_dev,
Ops.get_string(freshman, :arch, "unknown"),
instsys_arch
p_dev, freshman[:arch], instsys_arch
)
Ops.set(freshman, :arch_valid, true)
freshman[:arch_valid] = true

# Architecture is not matching
else
Builtins.y2milestone(
"Architecture for partition %1 is %2, upgrading %3",
p_dev,
Ops.get_string(freshman, :arch, "unknown"),
instsys_arch
p_dev, freshman[:arch], instsys_arch
)
Ops.set(freshman, :arch_valid, false)
freshman[:arch_valid] = false
end

# If architecture is not matching, the whole partition is considered to be wrong
if Ops.get_boolean(freshman, :arch_valid, false) != true
Builtins.y2milestone(
"Architecture is not valid -> the whole partition is not valid"
)
Ops.set(freshman, :valid, false)
if !freshman[:arch_valid]
log.info "Architecture is not valid -> the whole partition is not valid"
freshman[:valid] = false
end

if IncompleteInstallationDetected(Installation.destdir)
Builtins.y2milestone(
"Incomplete installation detected, partition is not valid"
)
Ops.set(freshman, :valid, false)
log.info "Incomplete installation detected, partition is not valid"
freshman[:valid] = false
end

Builtins.y2milestone(
Expand Down

0 comments on commit 2138d51

Please sign in to comment.