MCPcopy
hub / github.com/emacs-eaf/emacs-application-framework / get_distro

Function get_distro

install-eaf.py:285–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283 return updated
284
285def get_distro():
286 distro = ""
287 if sys.platform != "linux":
288 pass
289 elif which("dnf"):
290 distro = "dnf"
291 elif which("emerge"):
292 distro = "emerge"
293 elif which("apt"):
294 distro = "apt"
295 elif which("pacman"):
296 distro = "pacman"
297 aur_helper = get_archlinux_aur_helper()
298 if (not args.ignore_core_deps and not args.ignore_sys_deps and len(args.install) == 0) or args.install_core_deps:
299 try:
300 run_command([aur_helper, '-Sy', '--noconfirm', '--needed'])
301 except:
302 print("Run command `{} -Sy --noconfirm --needed' failed.".format(aur_helper))
303
304 elif which("pkg"):
305 distro = "pkg"
306 elif which("guix"):
307 distro = "guix"
308 elif which("zypper"):
309 distro = "zypper"
310 elif which("brew"):
311 distro = "brew"
312 elif which("nix"):
313 distro = "nix"
314 elif which("xbps-install"):
315 distro = "xbps"
316 elif sys.platform == "linux":
317 print("[EAF] Unsupported Linux distribution/package manager.")
318 print(" Please see dependencies.json for list of dependencies.")
319 if not (args.ignore_core_deps or args.ignore_sys_deps):
320 sys.exit(1)
321
322 return distro
323
324def install_core_deps(distro, deps_dict):
325 print("[EAF] Installing core dependencies")

Callers 3

install_py_depsFunction · 0.85
install_core_depsFunction · 0.85
mainFunction · 0.85

Calls 2

get_archlinux_aur_helperFunction · 0.85
run_commandFunction · 0.70

Tested by

no test coverage detected