Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-system-updater
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-system-updater
Commits
197e62f4
Commit
197e62f4
authored
Mar 28, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RebootRequired to UpdateCategory, use for reboot button logic
parent
7a754a31
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
update.go
model/update.go
+1
-0
update_service.go
service/update_service.go
+13
-9
actions.go
store/actions.go
+3
-1
window.go
ui/window.go
+1
-2
No files found.
model/update.go
View file @
197e62f4
...
...
@@ -4,6 +4,7 @@ type UpdateCategory struct {
Name
string
Enabled
bool
// User can toggle this category
Available
bool
// Has updates available
RebootRequired
bool
Packages
[]
Package
DownloadSize
uint64
InstallSize
int64
...
...
service/update_service.go
View file @
197e62f4
...
...
@@ -148,7 +148,13 @@ func (us *UpdateService) RunUpdates(ctx context.Context) error {
startTime
:=
time
.
Now
()
packagesUpdated
:=
0
var
categoryErrors
[]
string
systemOrKernelSucceeded
:=
false
rebootRequired
:=
false
categoryMap
:=
map
[
string
]
*
model
.
UpdateCategory
{
"System"
:
state
.
SystemUpdates
,
"Kernel"
:
state
.
KernelUpdates
,
"Play"
:
state
.
PlayUpdates
,
}
// Execute updates sequentially
for
_
,
category
:=
range
categories
{
...
...
@@ -158,13 +164,11 @@ func (us *UpdateService) RunUpdates(ctx context.Context) error {
continue
}
switch
category
{
case
"System"
:
packagesUpdated
+=
len
(
state
.
SystemUpdates
.
Packages
)
systemOrKernelSucceeded
=
true
case
"Kernel"
:
packagesUpdated
+=
len
(
state
.
KernelUpdates
.
Packages
)
systemOrKernelSucceeded
=
true
if
cat
,
ok
:=
categoryMap
[
category
];
ok
{
packagesUpdated
+=
len
(
cat
.
Packages
)
if
cat
.
RebootRequired
{
rebootRequired
=
true
}
}
}
...
...
@@ -176,7 +180,7 @@ func (us *UpdateService) RunUpdates(ctx context.Context) error {
us
.
store
.
Dispatch
(
&
store
.
FinishUpdateAction
{
Success
:
success
,
Error
:
strings
.
Join
(
categoryErrors
,
"; "
),
SystemOrKernelSucceeded
:
systemOrKernelSucceed
ed
,
RebootRequired
:
rebootRequir
ed
,
})
// Record in history
...
...
store/actions.go
View file @
197e62f4
...
...
@@ -28,6 +28,7 @@ func (a *LoadSystemUpdatesAction) Apply(state *State) error {
state
.
SystemUpdates
.
Packages
=
append
(
state
.
SystemUpdates
.
Packages
,
a
.
Changes
.
Install
...
)
state
.
SystemUpdates
.
DownloadSize
=
a
.
Changes
.
DownloadSize
state
.
SystemUpdates
.
InstallSize
=
a
.
Changes
.
InstallSize
state
.
SystemUpdates
.
RebootRequired
=
true
state
.
SystemUpdates
.
LastChecked
=
time
.
Now
()
.
Format
(
time
.
RFC3339
)
return
nil
}
...
...
@@ -42,6 +43,7 @@ func (a *LoadKernelUpdatesAction) Apply(state *State) error {
state
.
KernelUpdates
.
Packages
=
append
(
state
.
KernelUpdates
.
Packages
,
a
.
Info
.
Packages
.
Install
...
)
state
.
KernelUpdates
.
DownloadSize
=
a
.
Info
.
Packages
.
DownloadSize
state
.
KernelUpdates
.
InstallSize
=
a
.
Info
.
Packages
.
InstallSize
state
.
KernelUpdates
.
RebootRequired
=
true
state
.
KernelUpdates
.
LastChecked
=
time
.
Now
()
.
Format
(
time
.
RFC3339
)
return
nil
}
...
...
@@ -126,7 +128,7 @@ func (a *UpdateProgressAction) Apply(state *State) error {
type
FinishUpdateAction
struct
{
Success
bool
Error
string
SystemOrKernelSucceed
ed
bool
RebootRequir
ed
bool
}
func
(
a
*
FinishUpdateAction
)
Apply
(
state
*
State
)
error
{
...
...
ui/window.go
View file @
197e62f4
...
...
@@ -136,8 +136,7 @@ func (w *Window) onStateChange(change store.StateChange) {
case
store
.
ChangeUpdateFinish
:
action
,
ok
:=
change
.
Data
.
(
*
store
.
FinishUpdateAction
)
if
ok
{
showReboot
:=
action
.
Success
||
action
.
SystemOrKernelSucceeded
w
.
processPage
.
ShowComplete
(
action
.
Success
,
showReboot
)
w
.
processPage
.
ShowComplete
(
action
.
Success
,
action
.
RebootRequired
)
}
case
store
.
ChangeHistory
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment