aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticommon.lua
diff options
context:
space:
mode:
authoronefang2020-01-01 19:03:15 +1000
committeronefang2020-01-01 19:03:15 +1000
commit9c9226dced67b0e18fbc67cd31ccda585f39b322 (patch)
tree27c6ec94e318d1498909275940a86662e2fc67c0 /apt-panopticommon.lua
parentCut down on lower bandwidth files to HEAD check. (diff)
downloadapt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.zip
apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.gz
apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.bz2
apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.xz
Curl will try IPv4 as a backup if IPv6 fails, and we don't want that.
Tell it not to. Also detect if IPv6 is even available.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r--apt-panopticommon.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua
index e40ec0a..7664297 100644
--- a/apt-panopticommon.lua
+++ b/apt-panopticommon.lua
@@ -23,6 +23,7 @@ APT.verbosity = -1
23APT.origin = false 23APT.origin = false
24APT.redir = false 24APT.redir = false
25APT.keep = false 25APT.keep = false
26APT.IPv46 = ''
26 27
27APT.options = 28APT.options =
28{ 29{
@@ -119,6 +120,10 @@ APT.parseArgs = function(args)
119 APT.args = args 120 APT.args = args
120 local arg = {} 121 local arg = {}
121 local sendArgs = "" 122 local sendArgs = ""
123 -- A special test to disable IPv6 tests if IPv6 isn't available.
124 if 1 == APT.exe('ip -6 addr | grep inet6 | grep " global"'):Do().status then
125 table.insert(args, '--tests=-IPv6')
126 end
122 if 0 ~= #(args) then 127 if 0 ~= #(args) then
123 local option = "" 128 local option = ""
124 for i, a in pairs(args) do 129 for i, a in pairs(args) do
@@ -132,6 +137,9 @@ APT.parseArgs = function(args)
132 elseif "-q" == a then 137 elseif "-q" == a then
133 APT.verbosity = -1 138 APT.verbosity = -1
134 sendArgs = sendArgs .. a .. " " 139 sendArgs = sendArgs .. a .. " "
140 elseif ("-4" == a) or ("-6" == a) then
141 APT.IPv46 = a
142 sendArgs = sendArgs .. a .. " "
135 elseif "-k" == a then 143 elseif "-k" == a then
136 APT.keep = true 144 APT.keep = true
137 sendArgs = sendArgs .. a .. " " 145 sendArgs = sendArgs .. a .. " "