Skip to content

Commit 282d34d

Browse files
authored
Merge pull request #614 from jeffmcjunkin/patch-16
Move to apt-fast if available on Debian and derivates
2 parents c40ffe7 + 3f7a968 commit 282d34d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/platforms/debian.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ def base_install_modules(module_name):
2424
# depends
2525
if counter == 1:
2626
for module in modules:
27-
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + module)
27+
# Check if `apt-fast` is available, otherwise use apt-get
28+
if subprocess.Popen("which apt-fast >/dev/null", shell=True).wait() == 0:
29+
command = ("apt-fast -y install " + module)
30+
else:
31+
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + module)
2832
subprocess.Popen("export DEBIAN_FRONTEND=noninteractive;%s" %
29-
command, shell=True).wait()
33+
command, shell=True).wait()
3034
else:
3135
command = ("apt-get -q --allow-downgrades --allow-remove-essential --allow-change-held-packages -y install " + modules)
3236
subprocess.Popen("export DEBIAN_FRONTEND=noninteractive;%s" %

0 commit comments

Comments
 (0)