aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticommon.lua
diff options
context:
space:
mode:
authoronefang2019-12-28 22:49:01 +1000
committeronefang2019-12-28 22:49:01 +1000
commit98dcc0be5f0df60ba4c4e6c25c495ee3d83374b2 (patch)
treec02203afc33a2e832d2bd015b7e713d7b4b893c8 /apt-panopticommon.lua
parentLess time between wait checks. (diff)
downloadapt-panopticon-98dcc0be5f0df60ba4c4e6c25c495ee3d83374b2.zip
apt-panopticon-98dcc0be5f0df60ba4c4e6c25c495ee3d83374b2.tar.gz
apt-panopticon-98dcc0be5f0df60ba4c4e6c25c495ee3d83374b2.tar.bz2
apt-panopticon-98dcc0be5f0df60ba4c4e6c25c495ee3d83374b2.tar.xz
Add bandwidth argument and it's aliases, to choose how hard to hit the 'net.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r--apt-panopticommon.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua
index d9293f6..b1f39d7 100644
--- a/apt-panopticommon.lua
+++ b/apt-panopticommon.lua
@@ -26,6 +26,19 @@ APT.keep = false
26 26
27APT.options = 27APT.options =
28{ 28{
29 bandwidth =
30 {
31 typ = "number",
32 help = ' 0 = low - HTTP tests for all IPs of all mirrors (HEAD tests), but not URL sanity tests.\n' ..
33 ' 1 = medium - Also HTTP(S) redirect tests, other protocols, download Release files over HTTP, and check them.\n' ..
34 ' 2 = high - Also download Packages.xz files that changed, unpack and check them.\n' ..
35 ' Also download and check InRelease files\n.' ..
36 ' Pick a few small packages, download them, check their SHA512.\n' ..
37 ' 3 = more - Also pick more packages, some for each arch.\n' ..
38 ' 4 = all - Do absolutely everything.\n' ..
39 ' Actually download some Contents files, and some more Packages.xz, and package files.',
40 value = 2,
41 },
29 referenceSite = 42 referenceSite =
30 { 43 {
31 typ = "string", 44 typ = "string",
@@ -127,6 +140,24 @@ APT.parseArgs = function(args)
127 elseif "-r" == a then 140 elseif "-r" == a then
128 APT.redir = true 141 APT.redir = true
129 sendArgs = sendArgs .. a .. " " 142 sendArgs = sendArgs .. a .. " "
143 elseif "--low" == a then
144 APT.options.bandwidth.value = 0
145 APT.options.timeout.value = 2
146 APT.options.timeouts.value = 1
147 APT.options.retries.value = 1
148 sendArgs = sendArgs .. a .. " "
149 elseif "--medium" == a then
150 APT.options.bandwidth.value = 1
151 sendArgs = sendArgs .. a .. " "
152 elseif "--high" == a then
153 APT.options.bandwidth.value = 2
154 sendArgs = sendArgs .. a .. " "
155 elseif "--more" == a then
156 APT.options.bandwidth.value = 3
157 sendArgs = sendArgs .. a .. " "
158 elseif "--all" == a then
159 APT.options.bandwidth.value = 4
160 sendArgs = sendArgs .. a .. " "
130 elseif "--" == a:sub(1, 2) then 161 elseif "--" == a:sub(1, 2) then
131 local s, e = a:find("=") 162 local s, e = a:find("=")
132 if nil == s then e = -1 end 163 if nil == s then e = -1 end