Use pacman -Syu {package} instead of -S {package} to avoid updating when not installing
This commit is contained in:
parent
2170c19ce2
commit
0e2920d658
1 changed files with 9 additions and 11 deletions
20
install.py
20
install.py
|
@ -63,24 +63,22 @@ class Installer:
|
||||||
this_stderr: Optional[int] = subprocess.DEVNULL if self.hide_commands else None
|
this_stderr: Optional[int] = subprocess.DEVNULL if self.hide_commands else None
|
||||||
|
|
||||||
if operating_system in ("arch", "manjaro"):
|
if operating_system in ("arch", "manjaro"):
|
||||||
command = "sudo pacman -Syu"
|
|
||||||
operating_system = "arch"
|
operating_system = "arch"
|
||||||
|
# On Arch-based systems, will update while installing packages
|
||||||
|
|
||||||
elif operating_system in ("debian", "ubuntu"):
|
elif operating_system in ("debian", "ubuntu"):
|
||||||
command = "sudo apt update"
|
|
||||||
operating_system = "debian"
|
operating_system = "debian"
|
||||||
|
subprocess.run(
|
||||||
|
"sudo apt update",
|
||||||
|
check=True,
|
||||||
|
shell=True,
|
||||||
|
stdout=this_stdout,
|
||||||
|
stderr=this_stderr,
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise AssertionError("The operating system should have been defined")
|
raise AssertionError("The operating system should have been defined")
|
||||||
|
|
||||||
subprocess.run(
|
|
||||||
command,
|
|
||||||
check=True,
|
|
||||||
shell=True,
|
|
||||||
stdout=this_stdout,
|
|
||||||
stderr=this_stderr,
|
|
||||||
)
|
|
||||||
|
|
||||||
def evaluate_condition(self, condition: str) -> bool:
|
def evaluate_condition(self, condition: str) -> bool:
|
||||||
"""Run a bash command. On success return True, else return False."""
|
"""Run a bash command. On success return True, else return False."""
|
||||||
|
|
||||||
|
@ -215,7 +213,7 @@ class Installer:
|
||||||
ui.info_2("Installing packages...")
|
ui.info_2("Installing packages...")
|
||||||
for i, package in enumerate(packages):
|
for i, package in enumerate(packages):
|
||||||
if self.operating_system == "arch":
|
if self.operating_system == "arch":
|
||||||
command = "sudo pacman -S --needed --noconfirm {}".format(package)
|
command = "sudo pacman -Syu --needed --noconfirm {}".format(package)
|
||||||
elif self.operating_system == "debian":
|
elif self.operating_system == "debian":
|
||||||
command = "sudo apt install -y {}".format(package)
|
command = "sudo apt install -y {}".format(package)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue