Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SLE15-SP5] Fixed ERB template loading in self update (bsc#1219174) #647

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions package/yast2-packager.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Feb 8 13:49:00 UTC 2024 - Ladislav Slezák <[email protected]>

- Fixed ERB template loading in self update, if the template
cannot be found using a relative path then fallback to the
absolute path (bsc#1219174)
- 4.5.19

-------------------------------------------------------------------
Tue Jan 9 13:39:32 UTC 2024 - Ladislav Slezák <[email protected]>

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.18
Version: 4.5.19
Release: 0
Summary: YaST2 - Package Library
License: GPL-2.0-or-later
Expand Down
11 changes: 11 additions & 0 deletions src/lib/y2packager/dialogs/addon_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,18 @@ def initial_description
end

def product_description(product)
# first try the relative path
erb_file = File.join(__dir__, "product_summary.erb")

# in self update mode the some files might be updated and placed in
# a different directory and symlinked, but as Ruby uses absolute path
# for __dir__ then the relative file might not be found
if !File.exist?(erb_file)
log.info "ERB template #{erb_file} not found"
# use the absolute path as a fallback
erb_file = "/usr/share/YaST2/lib/y2packager/dialogs/product_summary.erb"
end

log.info "Loading ERB template #{erb_file}"
erb = ERB.new(File.read(erb_file))

Expand Down
Loading