Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorMário Victor Ribeiro Silva <mariovictorrs@gmail.com>2023-07-31 04:38:42 -0300
committerGitHub <noreply@github.com>2023-07-31 09:38:42 +0200
commit9cbb2b75940e3aad1a0236662c45437d70eac1af (patch)
tree5067a6a95a88213953e92f50d26969fecfd9ffa4 /archinstall
parent7dd95f8c690b2aa03d36589e33f9a117d1a62d0f (diff)
Parallel downloads (#1952)
* refactor: remove max_downloads limit * Update parallel downloads * Update parallel downloads
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/interactions/general_conf.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/archinstall/lib/interactions/general_conf.py b/archinstall/lib/interactions/general_conf.py
index 1c570a69..14fcc3f8 100644
--- a/archinstall/lib/interactions/general_conf.py
+++ b/archinstall/lib/interactions/general_conf.py
@@ -165,23 +165,20 @@ def ask_additional_packages_to_install(preset: List[str] = []) -> List[str]:
def add_number_of_parrallel_downloads(input_number :Optional[int] = None) -> Optional[int]:
- max_downloads = 5
- print(_(f"This option enables the number of parallel downloads that can occur during installation"))
- print(str(_("Enter the number of parallel downloads to be enabled.\n (Enter a value between 1 to {})\nNote:")).format(max_downloads))
- print(str(_(" - Maximum value : {} ( Allows {} parallel downloads, allows {} downloads at a time )")).format(max_downloads, max_downloads, max_downloads + 1))
- print(_(" - Minimum value : 1 ( Allows 1 parallel download, allows 2 downloads at a time )"))
- print(_(" - Disable/Default : 0 ( Disables parallel downloading, allows only 1 download at a time )"))
+ max_recommended = 5
+ print(_(f"This option enables the number of parallel downloads that can occur during package downloads"))
+ print(_("Enter the number of parallel downloads to be enabled.\n\nNote:\n"))
+ print(str(_(" - Maximum recommended value : {} ( Allows {} parallel downloads at a time )")).format(max_recommended, max_recommended))
+ print(_(" - Disable/Default : 0 ( Disables parallel downloading, allows only 1 download at a time )\n"))
while True:
try:
input_number = int(TextInput(_("[Default value: 0] > ")).run().strip() or 0)
if input_number <= 0:
input_number = 0
- elif input_number > max_downloads:
- input_number = max_downloads
break
except:
- print(str(_("Invalid input! Try again with a valid input [1 to {}, or 0 to disable]")).format(max_downloads))
+ print(str(_("Invalid input! Try again with a valid input [or 0 to disable]")).format(max_recommended))
pacman_conf_path = pathlib.Path("/etc/pacman.conf")
with pacman_conf_path.open() as f:
@@ -190,7 +187,7 @@ def add_number_of_parrallel_downloads(input_number :Optional[int] = None) -> Opt
with pacman_conf_path.open("w") as fwrite:
for line in pacman_conf:
if "ParallelDownloads" in line:
- fwrite.write(f"ParallelDownloads = {input_number+1}\n") if not input_number == 0 else fwrite.write("#ParallelDownloads = 0\n")
+ fwrite.write(f"ParallelDownloads = {input_number}\n") if not input_number == 0 else fwrite.write("#ParallelDownloads = 0\n")
else:
fwrite.write(f"{line}\n")