MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / update_distro_and_programs

Function update_distro_and_programs

Scripts/Developer Base/Mobile Desktop.py:1285–1306  ·  view source on GitHub ↗
(cfg: Dict, distro: str)

Source from the content-addressed store, hash-verified

1283 print(tr(cfg, "programs_done"))
1284
1285def update_distro_and_programs(cfg: Dict, distro: str) -> None:
1286 family = detect_family(distro)
1287 print(f"{tr(cfg,'update_title')} {distro}")
1288 if family == "debian":
1289 cmd = "apt-get update -y && apt-get upgrade -y && apt-get autoremove -y || true"
1290 elif family == "arch":
1291 cmd = "pacman -Syu --noconfirm || true"
1292 elif family == "alpine":
1293 cmd = "apk update && apk upgrade || true"
1294 elif family == "fedora":
1295 cmd = "dnf -y upgrade || true"
1296 elif family == "suse":
1297 cmd = "zypper --non-interactive refresh || true; zypper --non-interactive update || true"
1298 elif family == "void":
1299 cmd = "xbps-install -Suy || true"
1300 else:
1301 cmd = ""
1302 if not cmd:
1303 print(tr(cfg, "programs_not_supported"))
1304 return
1305 run(proot_login_cmd(distro, cmd), check=False)
1306 print(tr(cfg, "update_done"))
1307
1308# ----------------------------
1309# Launcher creation

Callers 1

action_updateFunction · 0.70

Calls 5

printFunction · 0.85
detect_familyFunction · 0.70
trFunction · 0.70
runFunction · 0.70
proot_login_cmdFunction · 0.70

Tested by

no test coverage detected