fix: Process for adapting v25 command line to set grub background#183
Open
pengfeixx wants to merge 1 commit intolinuxdeepin:masterfrom
Open
fix: Process for adapting v25 command line to set grub background#183pengfeixx wants to merge 1 commit intolinuxdeepin:masterfrom
pengfeixx wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
Process for adapting v25 command line to set grub background Log: Process for adapting v25 command line to set grub background pms: BUG-353671
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the grub background-setting process for v25 by using a new loader that may produce two background images, saving them directly instead of adjusting theme components, and updating tests accordingly. Sequence diagram for updated v25 grub background setting processsequenceDiagram
participant SetBackground
participant ImageLoader as loadV25BackgroundImage
participant FS as FileSystem
SetBackground->>FS: os.MkdirAll(themeOutputDir)
FS-->>SetBackground: error or nil
SetBackground->>ImageLoader: loadV25BackgroundImage()
ImageLoader-->>SetBackground: bgImg, themeBgImg, error
alt error from loadV25BackgroundImage
SetBackground->>SetBackground: logger.Fatal(err)
end
SetBackground->>FS: saveJpeg(bgImg, themeOutputDir/background.jpg)
FS-->>SetBackground: error or nil
alt themeBgImg is not nil
SetBackground->>FS: saveJpeg(themeBgImg, themeOutputDir/background_in_theme.jpg)
FS-->>SetBackground: error or nil
else themeBgImg is nil
SetBackground->>FS: copyFile(themeOutputDir/background.jpg, themeOutputDir/background_in_theme.jpg)
FS-->>SetBackground: error or nil
end
Note over SetBackground,FS: Previous flow parsing theme.txt and adjusting components is removed
Class diagram for updated background handling in adjust_grub_themeclassDiagram
class AdjustGrubTheme {
+setBackground(bgFile string)
+adjustTheme()
}
class ImageLoader {
+loadV25BackgroundImage() (bgImg Image, themeBgImg Image, err error)
}
class ImageUtils {
+saveJpeg(img Image, path string) error
+copyFile(src string, dst string) (written int64, err error)
}
class Image
AdjustGrubTheme ..> ImageLoader : uses
AdjustGrubTheme ..> ImageUtils : uses
AdjustGrubTheme ..> Image : background images
%% Previous responsibilities removed from setBackground:
%% - Parsing theme.txt via tt.ParseThemeFile
%% - Locating boot_menu component
%% - convertPropRel2Abs
%% - adjustBootMenuPixmapStyle
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The string literal "background_in_theme.jpg" is used multiple times; consider extracting it into a shared constant to avoid typos and ease future changes.
- In
setBackground, whenthemeBgImgis nil and you fall back to copyingbackground.jpg, consider adding a debug/info log so it's easier to distinguish between the primary and fallback paths during troubleshooting.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The string literal "background_in_theme.jpg" is used multiple times; consider extracting it into a shared constant to avoid typos and ease future changes.
- In `setBackground`, when `themeBgImg` is nil and you fall back to copying `background.jpg`, consider adding a debug/info log so it's easier to distinguish between the primary and fallback paths during troubleshooting.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process for adapting v25 command line to set grub background
Log: Process for adapting v25 command line to set grub background
pms: BUG-353671
Summary by Sourcery
Update GRUB background handling for v25 by simplifying background image generation and aligning outputs with the new command-line behavior.
Bug Fixes:
Tests: