feat: Refactor download size query logic and optimize display#330
feat: Refactor download size query logic and optimize display#330electricface wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: electricface 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 |
fce958c to
b49f0f6
Compare
|
TAG Bot New tag: 6.2.50 |
b49f0f6 to
660fe12
Compare
e7f1894 to
136d378
Compare
- Remove IsIncrementalUpdateCached function, use IncrementalUpdate flag to select backend - Implement queryDownloadSizeViaApt: Fetch download size via apt-get dist-upgrade command - Implement queryDownloadSizeForIncrementalUpdate: Fetch download size via deepin-immutable-ctl interface - QuerySourceDownloadSize automatically selects the method based on the IncrementalUpdate flag - Load IncrementalUpdate flag from config on startup and apply to system modules - Use FormatSize function for log output to standardize display format - Remove redundant checks from PackagesDownloadSize and updateModeStatusBySize Task: https://pms.uniontech.com/task-view-384185.html Change-Id: I427ccdd0a8d1151e48e2c305ff3008d5ba4cb25e
136d378 to
c337e7d
Compare
deepin pr auto reviewGit Diff 代码审查报告总体概述该代码变更主要涉及增量更新功能的改进,主要包括:
详细审查1. debian/rules- dh $@
+ dh $@ --buildsystem=makefile审查意见:
2. src/internal/system/apt/apt.go删除了 审查意见:
3. src/internal/system/system.govar IncrementalUpdate bool审查意见:
4. src/internal/system/system_apt.go新增函数:queryDownloadSizeViaApt审查意见:
新增函数:queryDownloadSizeForIncrementalUpdate审查意见:
修改函数:QuerySourceDownloadSize审查意见:
5. src/internal/utils/utils.go新增函数:FormatSize审查意见:
改进建议:
6. src/internal/utils/utils_test.go新增测试:TestFormatSize审查意见:
改进建议:
7. src/lastore-daemon/main.gologger.Info("incremental update:", config.IncrementalUpdate)
system.IncrementalUpdate = config.IncrementalUpdate审查意见:
8. src/lastore-daemon/manager_ifc.go- if m.config.IncrementalUpdate && size > 0 && apt.IsIncrementalUpdateCached("") {
- size = 0.0
- }审查意见:
9. src/lastore-daemon/update_status.go- sourceList, ok := system.GetCategorySourceMap()[typ]
- sourceArgs := ""
- if ok && sourceList != "" {
- if utils.IsDir(sourceList) {
- sourceArgs = "-o Dir::Etc::sourcelist=/dev/null -o Dir::Etc::SourceParts=" + sourceList
- } else {
- sourceArgs = "-o Dir::Etc::sourcelist=" + sourceList + " -o Dir::Etc::SourceParts=/dev/null"
- }
- }
- if m.lsConfig.IncrementalUpdate && needDownloadSize > 0 && apt.IsIncrementalUpdateCached(sourceArgs) {
- needDownloadSize = 0.0
- }审查意见:
安全性评估
性能评估
总结与建议
总体而言,这是一次高质量的代码变更,改进了增量更新功能的实现,提高了代码的可维护性和可读性。 |
|
TAG Bot New tag: 6.2.51 |
feat: 重构下载大小查询逻辑并优化显示