Skip to content

Commit

Permalink
feat: rename 'sys-upgrade' command to 'sys'
Browse files Browse the repository at this point in the history
  • Loading branch information
nellfs authored and kbdharun committed Jun 17, 2024
1 parent 97a2a36 commit cc966e1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Available Commands:
run Run an application from the subsystem
search Search for an application to install inside the subsystem
shell Enter the subsystem environment
sys-upgrade Upgrade the system
sys Execute system tasks, such as upgrading the system
tasks Create and manage tasks
unexport Unexport an application or binary from the subsystem
update Update the subsystem's package repository
Expand Down
5 changes: 4 additions & 1 deletion cmd/sys-upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ import (
func NewUpgradeCommand() *cmdr.Command {
// Root command
cmd := cmdr.NewCommand(
"sys-upgrade",
"sys",
vso.Trans("sysUpgrade.description"),
vso.Trans("sysUpgrade.description"),
nil,
)

// Backward compatibility
cmd.Aliases = []string{"sys-upgrade"}

// Subcommands
check := cmdr.NewCommand(
"check",
Expand Down
8 changes: 4 additions & 4 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pico:
description: "Upgrade the packages inside the subsystem"

sysUpgrade:
description: "Upgrade the system"
description: "Execute system commands, such as upgrading the system"
check:
asExitCode: "checks for upgrade but doesn't print anything. Return exit code 0 if no upgrade is available and 1 otherwise."
description: "Check for system updates"
Expand All @@ -111,7 +111,7 @@ sysUpgrade:
json:
description: "output the result in JSON format"
sysUpgrade:
description: "Upgrade the system"
description: "Execute system commands, such as upgrading the system"
error:
updating: "An error occured when updating the system."
onHasUpdate: "Error while searching for updates: %s."
Expand All @@ -121,8 +121,8 @@ sysUpgrade:
monthly: "monthly"
info:
updating: "Updating the system..."
willUpdateLater: "An update is available and will be automatically installed based on your %s schedule. You can force the update using 'vso sys-upgrade upgrade --now'."
willNeverUpdate: "An update is available, but will not be automatically installed because you disabled automatic updates. You can force the update using 'vso sys-upgrade upgrade --now'."
willUpdateLater: "An update is available and will be automatically installed based on your %s schedule. You can force the update using 'vso sys upgrade --now'."
willNeverUpdate: "An update is available, but will not be automatically installed because you disabled automatic updates. You can force the update using 'vso sys upgrade --now'."
noUpdates: "Your system is already up-to-date."
now: "Trigger a system upgrade now"

Expand Down
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import (
"github.com/vanilla-os/vanilla-system-operator/cmd"
)

var (
Version = "2.0.1"
)
var Version = "2.0.1"

//go:embed locales/*.yml
var fs embed.FS
Expand Down
12 changes: 6 additions & 6 deletions man/vso.1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The Vanilla System Operator is a package manager, a system updater and a task au
Create and manage tasks
.PP
.RE
\fBsys-upgrade\fP
\fBsys\fP
.RS 4
Upgrade the system
Execute system commands, such as upgrading the system
.PP
.RE
\fBconfig\fP
Expand Down Expand Up @@ -135,18 +135,18 @@ Remove a task
Rotate tasks
.PP
.RE
.SH SUBCOMMAND SYS-UPGRADE
.SH SUBCOMMAND SYS
.RS 4
Upgrade the system
Execute system commands, such as upgrading the system
.RE
.SS SYNOPSIS
.RS 4
\fBsys-upgrade\fP [command] [flags] [arguments]
\fBsys\fP [command] [flags] [arguments]
.RE
.SS DESCRIPTION
.RS 4
.TP 4
Upgrade the system
Execute system commands, such as upgrading the system
.RE
.SS OPTIONS
.SS GLOBAL OPTIONS
Expand Down
6 changes: 3 additions & 3 deletions polkit/org.vanillaos.vso.policy
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<vendor_url>https://www.vanillaos.org/</vendor_url>
<icon_name>package-x-generic</icon_name>

<action id="org.vanillaos.vso.sys-upgrade">
<description>Check for system package updates</description>
<action id="org.vanillaos.vso.sys">
<description>Execute system commands, such as upgrading the system</description>
<message>Authentication is required to check for updates</message>
<icon_name>package-x-generic</icon_name>
<defaults>
Expand All @@ -17,6 +17,6 @@
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/vso</annotate>
<annotate key="org.freedesktop.policykit.exec.argv1">sys-upgrade</annotate>
<annotate key="org.freedesktop.policykit.exec.argv1">sys</annotate>
</action>
</policyconfig>
2 changes: 1 addition & 1 deletion polkit/org.vanillaos.vso.rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
polkit.addRule(function(action, subject) {
if ((action.id == "org.vanillaos.vso.sys-upgrade" && subject.isInGroup("sudo"))
if ((action.id == "org.vanillaos.vso.sys" && subject.isInGroup("sudo"))
{
polkit.log("action=" + action);
polkit.log("subject=" + subject);
Expand Down

0 comments on commit cc966e1

Please sign in to comment.