-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsb.pluto
More file actions
executable file
·109 lines (100 loc) · 4.32 KB
/
sb.pluto
File metadata and controls
executable file
·109 lines (100 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/pluto
-- SPDX-License-Identifier: GPL-2.0
-- Copyright 2022-2023 - Fábio Rodrigues Ribeiro and contributors
x = os.execute
local u = require "util"
local ro = "rpm-ostree"
local roc = $"{ro} cancel && "
local osrelease = "/etc/os-release"
local variant = u.openfile_match(osrelease, "VARIANT_ID=(.-)$")
local function kv() io.write ($"Versão do kernel: {u.getoutput("uname -r")}\n") end
local function lastdeploy() io.write($"Data do último deploy: {u.openfile_match(osrelease,"VERSION=\"(.-)\"")}\n") end
local function rebasesb(plus,testing) x($"{ro} rebase fedora:fedora/{u.sbversion()+plus}/{u.arch()}{testing}/{variant}") end
local function pin() u.writemsg_x("sudo ostree admin pin 0","\n*** Pinning: \n") end
--[[
function open_override()
local pct = {}
local file = assert(io.open("override.txt","r"))
for line in file:lines() do pct = table.insert(pct,line) end
file:close()
return table.concat(pct," ")
end
]]--
local function rpmostree_upgrade(opts)
kv() lastdeploy() io.write "\n"
if os.getenv("DESKTOP_SESSION") == "gnome" then u.x_writemsg("gnome-software --quit","*** Parado gnome-software ***\n\n") end
x($"{roc} {ro} upgrade {opts}")
end
local function up()
io.write "\n*** Atualizando imagem ostree ***\n\n"
rpmostree_upgrade ""
u.x_writemsg("flatpak update -y","\n*** Terminado atualizar flatpak ***\n\n*** Atualizando toolbox ***\n\n")
x("toolbox run sudo dnf update -y")
end
local function clean() x($"sudo -s <<< \"{ro} cleanup -b -m && ostree admin cleanup\" && toolbox run dnf clean all") end
local function oua() for i = 2,5 do x($"sudo ostree admin pin --unpin {i}") end end
switch arg[1] do
-- ["reinstall"] = function() x "rpm-ostree upgrade --install=flatpak-builder" end
-- ["mesa-drm-freeworld"] = function() x "rpm-ostree override remove mesa-va-drivers --install=mesa-va-drivers-freeworld --install=mesa-vdpau-drivers-freeworld --install=ffmpeg" end,
-- --uninstall=rpmfusion-free-release-",self.__sbversion,"-1.noarch --uninstall=rpmfusion-nonfree-release-",self.__sbversion,"-1.noarch --install=https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-",self.__sbversion+1,".noarch.rpm --install=https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-",self.__sbversion+1,".noarch.rpm")
-- ["bulk-override-replace"] = function() print(("rpm-ostree override replace%s"):format(open_override())) end,
-- ["preview"] = function() x "rpm-ostree upgrade --preview" end,-- obsoleto
case "c-up": clean() up() break -- Funciona mas precisa fazer funções fora da tabela, solucionado
case "check-branch", "cb": x($"ostree remote refs fedora | grep -E \"{u.sbversion()+1}/{u.arch()}/{variant}$\"") break
case "install", "in": x($"{roc}{ro} upgrade --install={u.xargs()}") break
case "lastchange", "lc": x($"{ro} db diff") break
case "nextsb", "nsb": rebasesb(1,"") break
case "nexttest", "nt": rebasesb(1,"/testing") break
case "poweroff", "p": x "systemctl poweroff" break
case "reboot", "r": x "systemctl reboot" break
case "ro": x($"{roc}{ro}{u.xargs()}") break
case "search", "s": x($"{ro} search {u.xargs()}") break
case "search-inrpm": x("rpm -qa | grep -E {u.xargs()}") break
case "testsb": rebasesb(0,"/testing") break
case "up-r": rpmostree_upgrade "-r" break
case "clean", "c": clean() break
case "lastdeploy", "ld": lastdeploy() break
case "pin": pin() break
case "up": up() break
case "ostree-unpinall", "oua": oua() break
case "ostree-unpinall-pin", "ouap": oua() pin() break
default:
io.write
[[
Options:
cb, check-branch:
Check new branch
testsb:
Rebase to testing branch
nt, nexttest:
Upgrade to next testing version of silverblue
nsb, nextsb:
Upgrade to next version of silverblue
up:
Upgrade the role system to latest commit
install, in:
Install a layered package
c, clean:
Cleanup ostree based metadatas and cache
c-up:
Cleanup ostree based metadatas, cache and upgrade the role system to latest commit
pw, preview:
Dry-run of rpmostree upgrade
pin:
Pin the Ostree Deployment
mesa-drm-freeworld:
Install RPMFusion's mesa-drm freeworld (need configure rpmfusion repo)
search-inrpm:
Search for installed package
s, search:
Search for package
lc, lastchage:
Show last changes in rpm-ostree
ld, lastdeploy:
Show the last deploy in Silverblue
oua, ostree-unpinall:
Unpin all pinned commits
ouap, ostree-unpinall-pin:
Unpin all pinned commits and pin
]]
end