aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-11-26 00:51:33 +1000
committeronefang2019-11-26 00:51:33 +1000
commit7f2a78e5cdc27aa048b927efa6c3c2d66971b7d0 (patch)
tree48258656a056c147e5b848cc814eedb7b1e34b07
parentRemove more obsolete code. (diff)
downloadapt-panopticon-7f2a78e5cdc27aa048b927efa6c3c2d66971b7d0.zip
apt-panopticon-7f2a78e5cdc27aa048b927efa6c3c2d66971b7d0.tar.gz
apt-panopticon-7f2a78e5cdc27aa048b927efa6c3c2d66971b7d0.tar.bz2
apt-panopticon-7f2a78e5cdc27aa048b927efa6c3c2d66971b7d0.tar.xz
Minor cleanups.
-rwxr-xr-xapt-panopticon.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index f2eca59..a3857b3 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -763,7 +763,6 @@ end
763 763
764--print(dumpTable(options.tests.value, "", "tests")) 764--print(dumpTable(options.tests.value, "", "tests"))
765 765
766execute("mkdir -p results")
767 766
768if 0 < #arg then 767if 0 < #arg then
769 if "/" == arg[1]:sub(-1, -1) then 768 if "/" == arg[1]:sub(-1, -1) then
@@ -815,8 +814,7 @@ if 0 < #arg then
815 else 814 else
816 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) 815 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3])
817 end 816 end
818 logPost() 817
819 logFile:close()
820 local f = pu.host 818 local f = pu.host
821 if "" ~= ip then f = f .. "_" .. ip end 819 if "" ~= ip then f = f .. "_" .. ip end
822 local rfile, e = io.open("results/" .. f .. ".lua", "w+") 820 local rfile, e = io.open("results/" .. f .. ".lua", "w+")
@@ -824,6 +822,8 @@ if 0 < #arg then
824 rfile:write(dumpTable(results, "", "results") .. "\nreturn results\n") 822 rfile:write(dumpTable(results, "", "results") .. "\nreturn results\n")
825 rfile:close() 823 rfile:close()
826 end 824 end
825 logPost()
826 logFile:close()
827else 827else
828 if not keep then 828 if not keep then
829 os.execute("rm -f results/*.log") 829 os.execute("rm -f results/*.log")
@@ -835,7 +835,7 @@ else
835 if nil == logFile then C("opening log file - " .. e); return end 835 if nil == logFile then C("opening log file - " .. e); return end
836 logPre() 836 logPre()
837 I("Starting tests " .. table.concat(options.tests.value, ", ")) 837 I("Starting tests " .. table.concat(options.tests.value, ", "))
838 execute("mkdir -p results") 838 os.execute("mkdir -p results")
839 mirrors = getMirrors() 839 mirrors = getMirrors()
840 checkHost(options.referenceSite.value) 840 checkHost(options.referenceSite.value)
841 for k, m in pairs(mirrors) do 841 for k, m in pairs(mirrors) do
@@ -870,7 +870,8 @@ else
870 execute("./" .. report .. " ") 870 execute("./" .. report .. " ")
871 end 871 end
872 end 872 end
873
874-- os.execute("rm -f results/*.lua")
873 logPost() 875 logPost()
874 os.execute("rm -f results/*.lua")
875 logFile:close() 876 logFile:close()
876end 877end