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

Function remove_custom_package

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

Source from the content-addressed store, hash-verified

1219 return pid
1220
1221def remove_custom_package(cfg: Dict, distro: str, pkg: str) -> None:
1222 pkg = _validate_pkg_name(pkg)
1223 if not pkg:
1224 print(tr(cfg, "invalid"))
1225 return
1226
1227 family = detect_family(distro)
1228 if family == "debian":
1229 cmd = f"apt-get remove -y {pkg} || true && apt-get autoremove -y || true"
1230 elif family == "arch":
1231 cmd = f"pacman -Rns --noconfirm {pkg} || true"
1232 elif family == "alpine":
1233 cmd = f"apk del {pkg} || true"
1234 elif family == "fedora":
1235 cmd = f"dnf -y remove {pkg} || true"
1236 elif family == "suse":
1237 cmd = f"zypper --non-interactive remove {pkg} || true"
1238 elif family == "void":
1239 cmd = f"xbps-remove -Ry {pkg} || true"
1240 else:
1241 print(tr(cfg, "programs_not_supported"))
1242 return
1243
1244 print(f"{tr(cfg,'programs_removing')} {pkg}")
1245 run(proot_login_cmd(distro, cmd), check=False)
1246 print(tr(cfg, "programs_done"))
1247
1248
1249def install_program(cfg: Dict, distro: str, pid: str) -> None:

Callers 1

remove_programFunction · 0.70

Calls 6

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

Tested by

no test coverage detected