aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xapt-panopticon.lua32
1 files changed, 16 insertions, 16 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index f0a3128..92a5125 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -472,7 +472,7 @@ checkHEAD = function (host, URL, r, retry, sanity)
472 IP .. ' ' .. '-o /dev/null -D results/"HEADERS_' .. fname .. '" ' .. 472 IP .. ' ' .. '-o /dev/null -D results/"HEADERS_' .. fname .. '" ' ..
473 hdr .. ' -w "#%{http_code} %{ssl_verify_result} %{url_effective}\\n" ' .. PU.scheme .. '://' .. host .. PU.path .. ' >>results/"STATUS_' .. fname .. '"' 473 hdr .. ' -w "#%{http_code} %{ssl_verify_result} %{url_effective}\\n" ' .. PU.scheme .. '://' .. host .. PU.path .. ' >>results/"STATUS_' .. fname .. '"'
474 local status, result = execute(cmd) 474 local status, result = execute(cmd)
475 os.execute('cat results/"HEADERS_' .. fname .. '" >>results/"STATUS_' .. fname .. '" 2>/dev/null; rm results/"HEADERS_' .. fname .. '" 2>/dev/null') 475 os.execute('cat results/"HEADERS_' .. fname .. '" >>results/"STATUS_' .. fname .. '" 2>/dev/null; rm -f results/"HEADERS_' .. fname .. '" 2>/dev/null')
476 if "0" ~= status then 476 if "0" ~= status then
477 local msg = curlStatus[0 + status] 477 local msg = curlStatus[0 + status]
478 if nil == msg then msg = "UNKNOWN CURL STATUS CODE!" end 478 if nil == msg then msg = "UNKNOWN CURL STATUS CODE!" end
@@ -509,7 +509,7 @@ checkHEAD = function (host, URL, r, retry, sanity)
509 end 509 end
510 end 510 end
511 end 511 end
512 os.execute('rm results/"STATUS_' .. fname .. '" 2>/dev/null') 512 os.execute('rm -f results/"STATUS_' .. fname .. '" 2>/dev/null')
513 if ("4" == tostring(code):sub(1, 1)) or ("5" == tostring(code):sub(1, 1)) then 513 if ("4" == tostring(code):sub(1, 1)) or ("5" == tostring(code):sub(1, 1)) then
514 if sanity then 514 if sanity then
515 E(" " .. code .. " " .. cstr .. ". " .. check .. " " .. host .. " -> " .. URL, PU.scheme, "URLSanity", host) 515 E(" " .. code .. " " .. cstr .. ". " .. check .. " " .. host .. " -> " .. URL, PU.scheme, "URLSanity", host)
@@ -730,8 +730,8 @@ local postDownload = function(host, r, k)
730 end 730 end
731 end 731 end
732 end 732 end
733 os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages') 733 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages 2>/dev/null')
734 os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.*') 734 os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.* 2>/dev/null')
735 end 735 end
736 end 736 end
737end 737end
@@ -920,7 +920,7 @@ if 0 < #arg then
920 920
921 if testing("Integrity") or testing("Updated") then 921 if testing("Integrity") or testing("Updated") then
922 if origin and options.referenceSite.value == pu.host then 922 if origin and options.referenceSite.value == pu.host then
923-- if not keep then execute("rm -fr results/" .. pu.host) end 923-- if not keep then execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end
924 end 924 end
925 end 925 end
926 926
@@ -962,7 +962,7 @@ if 0 < #arg then
962 if 4 > (totalTimeouts) then 962 if 4 > (totalTimeouts) then
963 if origin and (options.roundRobin.value ~= pu.host) then 963 if origin and (options.roundRobin.value ~= pu.host) then
964 while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end 964 while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end
965 os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. 965 os.execute( "rm -f results/" .. pu.host .. ".curl 2>/dev/null; rm -f results/curl-META-" .. pu.host .. ".lock 2>/dev/null; " ..
966 "mv results/curl-META-" .. pu.host .. ".log results/curl-Release-" .. pu.host .. ".log") 966 "mv results/curl-META-" .. pu.host .. ".log results/curl-Release-" .. pu.host .. ".log")
967 for i, n in pairs(releases) do 967 for i, n in pairs(releases) do
968 for l, o in pairs(releaseFiles) do 968 for l, o in pairs(releaseFiles) do
@@ -994,7 +994,7 @@ if 0 < #arg then
994 994
995 downloads(pu.host, pu.path, "", "") 995 downloads(pu.host, pu.path, "", "")
996 while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end 996 while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end
997 os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. 997 os.execute( "rm -f results/" .. pu.host .. ".curl 2>/dev/null; rm -f results/curl-META-" .. pu.host .. ".lock 2>/dev/null; " ..
998 "mv results/curl-META-" .. pu.host .. ".log results/curl-Packages-" .. pu.host .. ".log") 998 "mv results/curl-META-" .. pu.host .. ".log results/curl-Packages-" .. pu.host .. ".log")
999 999
1000 for i, n in pairs(releases) do 1000 for i, n in pairs(releases) do
@@ -1062,7 +1062,7 @@ if 0 < #arg then
1062 end 1062 end
1063 1063
1064 if origin and options.referenceSite.value ~= pu.host then 1064 if origin and options.referenceSite.value ~= pu.host then
1065 if not keep then os.execute("rm -fr results/" .. pu.host) end 1065 if not keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end
1066 os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null') 1066 os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null')
1067 end 1067 end
1068 1068
@@ -1100,15 +1100,15 @@ else
1100 local fodt = io.popen('TZ="GMT" date -r results/stamp +%Y-%m-%d-%H-%M', 'r') 1100 local fodt = io.popen('TZ="GMT" date -r results/stamp +%Y-%m-%d-%H-%M', 'r')
1101 odt = fodt:read('*l') 1101 odt = fodt:read('*l')
1102 fodt:close() 1102 fodt:close()
1103 os.execute(' rm results_old; ln -s results_' .. odt .. ' results_old') 1103 os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null')
1104 os.execute('mkdir -p results_' .. dt .. '; rm results; ln -s results_' .. dt .. ' results') 1104 os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null')
1105 os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp') 1105 os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp')
1106 os.execute("rm -f results/*.check") 1106 os.execute("rm -f results/*.check 2>/dev/null")
1107 if not keep then 1107 if not keep then
1108 os.execute("rm -f results/*.curl") 1108 os.execute("rm -f results/*.curl 2>/dev/null")
1109 os.execute("rm -f results/*.log") 1109 os.execute("rm -f results/*.log 2>/dev/null")
1110 os.execute("rm -f results/*.html") 1110 os.execute("rm -f results/*.html 2>/dev/null")
1111 os.execute("rm -f results/*.txt") 1111 os.execute("rm -f results/*.txt 2>/dev/null")
1112 end 1112 end
1113 1113
1114 logFile, e = io.open("results/LOG_apt-panopticon.html", "a+") 1114 logFile, e = io.open("results/LOG_apt-panopticon.html", "a+")
@@ -1141,7 +1141,7 @@ else
1141 1141
1142 while 1 <= checkExes("apt-panopticon.lua " .. sendArgs) do os.execute("sleep 10") end 1142 while 1 <= checkExes("apt-panopticon.lua " .. sendArgs) do os.execute("sleep 10") end
1143 1143
1144 os.execute("rm -f results/*.check; rm -f results/*.lock") 1144 os.execute("rm -f results/*.check; rm -f results/*.lock 2>/dev/null")
1145 1145
1146 -- Create the reports. 1146 -- Create the reports.
1147 for n, r in pairs(options.reports.value) do 1147 for n, r in pairs(options.reports.value) do