daca2-report: better handling when no packages found

This commit is contained in:
Daniel Marjamäki 2017-06-03 14:03:16 +02:00
parent 73ac088688
commit 6ac1aafa49
1 changed files with 45 additions and 51 deletions

View File

@ -2,7 +2,6 @@ import os
import sys
import subprocess
def readdate(data):
datepos = -1
if data[:5] == 'DATE ':
@ -77,23 +76,18 @@ for lib in [False, True]:
for a in "0123456789abcdefghijklmnopqrstuvwxyz":
if lib == True:
a = "lib" + a
if os.path.isfile(daca2 + a + '/results.txt'):
if not os.path.isfile(daca2 + a + '/results.txt'):
continue
f = open(daca2 + a + '/results.txt', 'rt')
data = f.read()
f.close()
if data.find('ftp://')<0:
continue
datestr = readdate(data)
if os.path.isfile(daca2 + 'results-' + a + '.txt'):
f2 = open(daca2 + 'results-' + a + '.txt')
data2 = f2.read()
f2.close()
datestr2 = readdate(data2)
if not datestr or datestr < datestr2:
data = data2
datestr = datestr2
if datestr:
if not lastupdate or datestr > lastupdate:
lastupdate = datestr