Skip to content

Commit

Permalink
Merge pull request #620 from yast/merge-SLE-15-SP4
Browse files Browse the repository at this point in the history
Fix package counters during installation (boo#1199621)
  • Loading branch information
imobachgs committed May 19, 2022
2 parents 2f54b72 + 676d535 commit 39376d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue May 17 20:49:27 UTC 2022 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Fix package counters in the installation slideshow
(boo#1199621).
- 4.5.4

-------------------------------------------------------------------
Tue May 3 06:50:36 UTC 2022 - Ladislav Slezák <lslezak@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: 4.5.3
Version: 4.5.4
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand Down
18 changes: 12 additions & 6 deletions src/modules/PackageSlideShow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def init_member_vars
@updated_pkg_list = []
@removed_pkg_list = []

# Keep counters for installed, updated and removed packages
@installed_pkg_count = 0
@updated_pkg_count = 0
@removed_pkg_count = 0

# This is a kludge to pass information from one callback that gets the
# needed information (the pkg name) to another that doesn't.
@updating = false
Expand All @@ -60,9 +65,9 @@ def ResetPackageSummary

def GetPackageSummary
{
"installed" => @installed_pkg_list.size,
"updated" => @updated_pkg_list.size,
"removed" => @removed_pkg_list.size,
"installed" => @installed_pkg_count,
"updated" => @updated_pkg_count,
"removed" => @removed_pkg_count,
"installed_list" => @installed_pkg_list,
"updated_list" => @updated_pkg_list,
"removed_list" => @removed_pkg_list,
Expand Down Expand Up @@ -260,8 +265,6 @@ def UpdateDownloadProgressText
# packages; or, for parallel download + installation, also for downloading.
#
def UpdateInstallationProgressText
installed_pkg = @installed_pkg_list.size
updated_pkg = @updated_pkg_list.size
remaining_string = FormatRemainingSize(@total_size_to_install - @total_installed_size)
remaining_string += ", " unless remaining_string.empty?

Expand All @@ -270,7 +273,7 @@ def UpdateInstallationProgressText
Builtins.sformat(
_(" (Remaining: %1%2 packages)"),
remaining_string,
@total_pkgs_to_install - installed_pkg - updated_pkg
@total_pkgs_to_install - @installed_pkg_count - @updated_pkg_count
)
)

Expand Down Expand Up @@ -384,6 +387,7 @@ def PkgInstallProgress(_pkg_percent)
def PkgInstallDone(pkg_name, pkg_size, deleting)
if deleting
@removed_pkg_list << pkg_name if Mode.normal
@removed_pkg_count += 1
log.info "Uninstalled package #{pkg_name}"
else # installing or updating
@total_installed_size += pkg_size
Expand All @@ -393,9 +397,11 @@ def PkgInstallDone(pkg_name, pkg_size, deleting)

if @updating
@updated_pkg_list << pkg_name if Mode.normal
@updated_pkg_count += 1
log.info "Updated package #{pkg_name}"
else
@installed_pkg_list << pkg_name if Mode.normal
@installed_pkg_count += 1
log.info "Installed package #{pkg_name}"
end
end
Expand Down

0 comments on commit 39376d6

Please sign in to comment.