diff options
author | onefang | 2019-12-12 17:21:39 +1000 |
---|---|---|
committer | onefang | 2019-12-12 17:21:39 +1000 |
commit | 2b71b2ed47a778ead5d14e5e395ba278b9a605ea (patch) | |
tree | 58ba011aef991a22aeb89673a4154d90638b34f2 | |
parent | Do the curl log file stuff differently. (diff) | |
download | apt-panopticon-2b71b2ed47a778ead5d14e5e395ba278b9a605ea.zip apt-panopticon-2b71b2ed47a778ead5d14e5e395ba278b9a605ea.tar.gz apt-panopticon-2b71b2ed47a778ead5d14e5e395ba278b9a605ea.tar.bz2 apt-panopticon-2b71b2ed47a778ead5d14e5e395ba278b9a605ea.tar.xz |
Attempt to clean up after mirrors timeout.
It still wont clean up the STATUS_* files, so only partially fixed.
-rwxr-xr-x | apt-panopticon.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 5dc2570..33d1ef3 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -784,11 +784,6 @@ if 0 < #arg then | |||
784 | end | 784 | end |
785 | end | 785 | end |
786 | 786 | ||
787 | if APT.origin and APT.options.referenceSite.value ~= pu.host then | ||
788 | if not APT.keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end | ||
789 | os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null') | ||
790 | end | ||
791 | |||
792 | local min, max, spd = 999999999999, 0 | 787 | local min, max, spd = 999999999999, 0 |
793 | for i, mt in pairs({'Release', 'Packages', 'package'}) do | 788 | for i, mt in pairs({'Release', 'Packages', 'package'}) do |
794 | if APT.checkFile("results/curl-" .. mt .. "-" .. pu.host .. ".log") then | 789 | if APT.checkFile("results/curl-" .. mt .. "-" .. pu.host .. ".log") then |
@@ -820,6 +815,16 @@ if 0 < #arg then | |||
820 | rfile:write(APT.dumpTable(APT.results, "", "results") .. "\nreturn results\n") | 815 | rfile:write(APT.dumpTable(APT.results, "", "results") .. "\nreturn results\n") |
821 | rfile:close() | 816 | rfile:close() |
822 | end | 817 | end |
818 | |||
819 | if APT.origin and APT.options.referenceSite.value ~= pu.host then | ||
820 | while 0 < APT.checkExes(downloadLock .. "Release-" .. pu.host .. ".log") do os.execute("sleep 10") end | ||
821 | while 0 < APT.checkExes(downloadLock .. "package-" .. pu.host .. ".log") do os.execute("sleep 10") end | ||
822 | while 0 < APT.checkExes(downloadLock .. "Packages-" .. pu.host .. ".log") do os.execute("sleep 10") end | ||
823 | os.execute("sleep 5") | ||
824 | if not APT.keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end | ||
825 | os.execute('rm STATUS_' .. pu.host .. '_* 2>/dev/null') | ||
826 | end | ||
827 | |||
823 | APT.logPost() | 828 | APT.logPost() |
824 | APT.logFile:close() | 829 | APT.logFile:close() |
825 | else | 830 | else |