From 8d06f5bdf17dba43fb2a65f5bf145e2d377aa31e Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 4 Dec 2019 23:55:56 +1000 Subject: Not being able to remove a non existing file isn't a failure. I hates that error message. lol --- apt-panopticon.lua | 32 ++++++++++++++++---------------- 1 file 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) IP .. ' ' .. '-o /dev/null -D results/"HEADERS_' .. fname .. '" ' .. hdr .. ' -w "#%{http_code} %{ssl_verify_result} %{url_effective}\\n" ' .. PU.scheme .. '://' .. host .. PU.path .. ' >>results/"STATUS_' .. fname .. '"' local status, result = execute(cmd) - os.execute('cat results/"HEADERS_' .. fname .. '" >>results/"STATUS_' .. fname .. '" 2>/dev/null; rm results/"HEADERS_' .. fname .. '" 2>/dev/null') + os.execute('cat results/"HEADERS_' .. fname .. '" >>results/"STATUS_' .. fname .. '" 2>/dev/null; rm -f results/"HEADERS_' .. fname .. '" 2>/dev/null') if "0" ~= status then local msg = curlStatus[0 + status] if nil == msg then msg = "UNKNOWN CURL STATUS CODE!" end @@ -509,7 +509,7 @@ checkHEAD = function (host, URL, r, retry, sanity) end end end - os.execute('rm results/"STATUS_' .. fname .. '" 2>/dev/null') + os.execute('rm -f results/"STATUS_' .. fname .. '" 2>/dev/null') if ("4" == tostring(code):sub(1, 1)) or ("5" == tostring(code):sub(1, 1)) then if sanity then E(" " .. code .. " " .. cstr .. ". " .. check .. " " .. host .. " -> " .. URL, PU.scheme, "URLSanity", host) @@ -730,8 +730,8 @@ local postDownload = function(host, r, k) end end end - os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages') - os.execute('rm results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.*') + os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages 2>/dev/null') + os.execute('rm -f results/' .. host .. '/merged/dists/' .. r .. dir .. 'Packages.* 2>/dev/null') end end end @@ -920,7 +920,7 @@ if 0 < #arg then if testing("Integrity") or testing("Updated") then if origin and options.referenceSite.value == pu.host then --- if not keep then execute("rm -fr results/" .. pu.host) end +-- if not keep then execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end end end @@ -962,7 +962,7 @@ if 0 < #arg then if 4 > (totalTimeouts) then if origin and (options.roundRobin.value ~= pu.host) then while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end - os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. + os.execute( "rm -f results/" .. pu.host .. ".curl 2>/dev/null; rm -f results/curl-META-" .. pu.host .. ".lock 2>/dev/null; " .. "mv results/curl-META-" .. pu.host .. ".log results/curl-Release-" .. pu.host .. ".log") for i, n in pairs(releases) do for l, o in pairs(releaseFiles) do @@ -994,7 +994,7 @@ if 0 < #arg then downloads(pu.host, pu.path, "", "") while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end - os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. + os.execute( "rm -f results/" .. pu.host .. ".curl 2>/dev/null; rm -f results/curl-META-" .. pu.host .. ".lock 2>/dev/null; " .. "mv results/curl-META-" .. pu.host .. ".log results/curl-Packages-" .. pu.host .. ".log") for i, n in pairs(releases) do @@ -1062,7 +1062,7 @@ if 0 < #arg then end if origin and options.referenceSite.value ~= pu.host then - if not keep then os.execute("rm -fr results/" .. pu.host) end + if not keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null') end @@ -1100,15 +1100,15 @@ else local fodt = io.popen('TZ="GMT" date -r results/stamp +%Y-%m-%d-%H-%M', 'r') odt = fodt:read('*l') fodt:close() - os.execute(' rm results_old; ln -s results_' .. odt .. ' results_old') - os.execute('mkdir -p results_' .. dt .. '; rm results; ln -s results_' .. dt .. ' results') + os.execute(' rm -f results_old; ln -s results_' .. odt .. ' results_old 2>/dev/null') + os.execute('mkdir -p results_' .. dt .. '; rm -f results; ln -s results_' .. dt .. ' results 2>/dev/null') os.execute('if [ -f results/stamp ]; then mv results/stamp results/stamp.old; else touch results/stamp.old -t 199901010000; fi; touch results/stamp') - os.execute("rm -f results/*.check") + os.execute("rm -f results/*.check 2>/dev/null") if not keep then - os.execute("rm -f results/*.curl") - os.execute("rm -f results/*.log") - os.execute("rm -f results/*.html") - os.execute("rm -f results/*.txt") + os.execute("rm -f results/*.curl 2>/dev/null") + os.execute("rm -f results/*.log 2>/dev/null") + os.execute("rm -f results/*.html 2>/dev/null") + os.execute("rm -f results/*.txt 2>/dev/null") end logFile, e = io.open("results/LOG_apt-panopticon.html", "a+") @@ -1141,7 +1141,7 @@ else while 1 <= checkExes("apt-panopticon.lua " .. sendArgs) do os.execute("sleep 10") end - os.execute("rm -f results/*.check; rm -f results/*.lock") + os.execute("rm -f results/*.check; rm -f results/*.lock 2>/dev/null") -- Create the reports. for n, r in pairs(options.reports.value) do -- cgit v1.1