-
Notifications
You must be signed in to change notification settings - Fork 7
/
dnf-faster.patch
26 lines (25 loc) · 1.47 KB
/
dnf-faster.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff -uNar /usr/lib/python3.8/site-packages/dnf-old/base.py /usr/lib/python3.8/site-packages/dnf/base.py
--- /usr/lib/python3.8/site-packages/dnf-old/base.py 2019-12-02 16:48:50.286793493 +0600
+++ /usr/lib/python3.8/site-packages/dnf/base.py 2019-12-02 17:14:40.949184980 +0600
@@ -1151,6 +1151,8 @@
payloads = [dnf.repo._pkg2payload(pkg, progress, drpm.delta_factory,
dnf.repo.RPMPayload)
for pkg in remote_pkgs]
+ import dnf.chitholian as chitholian
+ chitholian.downloadPackagesNow(remote_pkgs)
self._download_remote_payloads(payloads, drpm, progress, callback_total)
if self.conf.destdir:
diff -uNar /usr/lib/python3.8/site-packages/dnf-old/chitholian.py /usr/lib/python3.8/site-packages/dnf/chitholian.py
--- /usr/lib/python3.8/site-packages/dnf-old/chitholian.py 1970-01-01 06:00:00.000000000 +0600
+++ /usr/lib/python3.8/site-packages/dnf/chitholian.py 2019-12-02 17:13:11.086472829 +0600
@@ -0,0 +1,10 @@
+import os
+
+def downloadPackagesNow(pkgs):
+ with open('/tmp/arcpkglist.txt', 'w+') as f:
+ for p in pkgs:
+ f.write("{}\n\tout={}\n\tdir={}\n".format(p.remote_location(), os.path.basename(p.localPkg()), os.path.dirname(p.localPkg())))
+ f.close()
+
+ os.system('aria2c --split=8 --continue=true --max-concurrent-downloads=7 --max-connection-per-server=8 --min-split-size=1M --input-file=/tmp/arcpkglist.txt')
+