mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Fixed a very silly bug in updatestats.py
This commit is contained in:
parent
f724d98f30
commit
e9228b5833
@ -70,22 +70,22 @@ if options.download:
|
|||||||
|
|
||||||
ftp.chdir('logs')
|
ftp.chdir('logs')
|
||||||
files = ftp.listdir()
|
files = ftp.listdir()
|
||||||
for file in files:
|
for f in files:
|
||||||
if file.startswith('access-') and file.endswith('.log'):
|
if f.startswith('access-') and f.endswith('.log'):
|
||||||
|
|
||||||
destpath = os.path.join(logsdir, file)
|
destpath = os.path.join(logsdir, f)
|
||||||
archivepath = os.path.join(logsarchivedir, file + '.gz')
|
archivepath = os.path.join(logsarchivedir, f + '.gz')
|
||||||
if os.path.exists(archivepath):
|
if os.path.exists(archivepath):
|
||||||
if os.path.exists(destpath):
|
if os.path.exists(destpath):
|
||||||
# Just in case we have it archived but failed to remove
|
# Just in case we have it archived but failed to remove
|
||||||
# the original...
|
# the original...
|
||||||
os.remove(destpath)
|
os.remove(destpath)
|
||||||
else:
|
else:
|
||||||
destsize = ftp.stat(file).st_size
|
destsize = ftp.stat(f).st_size
|
||||||
if (not os.path.exists(destpath) or
|
if (not os.path.exists(destpath) or
|
||||||
os.path.getsize(destpath) != destsize):
|
os.path.getsize(destpath) != destsize):
|
||||||
print "...retrieving " + file
|
print "...retrieving " + f
|
||||||
ftp.get(file, destpath)
|
ftp.get(f, destpath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user