mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
Don't need the date calculation code any more
This commit is contained in:
parent
984b1ee918
commit
2b1b2e7497
36
update.py
36
update.py
@ -473,42 +473,6 @@ shutil.copyfile(repo_icon, iconfilename)
|
||||
knownapks = common.KnownApks()
|
||||
for apk in apks:
|
||||
knownapks.recordapk(apk['apkname'], apk['id'])
|
||||
|
||||
app, added = knownapks.getapp(apk['apkname'])
|
||||
if not added:
|
||||
print 'Need a date for ' + apk['apkname']
|
||||
p = subprocess.Popen('git log --format="%ci" metadata/' + apk['id'] + '.txt | tail -n 1',
|
||||
shell=True, stdout = subprocess.PIPE)
|
||||
d = p.communicate()[0][:10]
|
||||
if len(d) == 0:
|
||||
print "...didn't find a metadata commit"
|
||||
else:
|
||||
print '...metadata committed:' + d
|
||||
if apk['apkname'].startswith(apk['id']):
|
||||
vercode = int(apk['apkname'][len(apk['id'])+1:-4])
|
||||
print '...built vercode:' + str(vercode)
|
||||
expr = 'Build Version:[^,]+,' + str(vercode) + ',.*'
|
||||
p = subprocess.Popen('git log --format="%ci" -S"' + expr + '" --pickaxe-regex metadata/' + apk['id'] + '.txt | tail -n 1',
|
||||
shell=True, stdout = subprocess.PIPE)
|
||||
d = p.communicate()[0][:10]
|
||||
if len(d) > 0:
|
||||
print '...build line added:' + d
|
||||
print '...using that!'
|
||||
knownapks.apks[apk['apkname']] = (apk['id'], time.strptime(d, '%Y-%m-%d'))
|
||||
knownapks.changed = True
|
||||
else:
|
||||
print "...didn't find addition of build line"
|
||||
else:
|
||||
oldestvercode = 99999999
|
||||
for apk2 in apks:
|
||||
if apk2['id'] == apk['id']:
|
||||
if apk2['versioncode'] < oldestvercode:
|
||||
oldestvercode = apk2['versioncode']
|
||||
if oldestvercode == apk['versioncode']:
|
||||
print '...oldest non-built apk - using metadata commit date'
|
||||
knownapks.apks[apk['apkname']] = (apk['id'], time.strptime(d, '%Y-%m-%d'))
|
||||
knownapks.changed = True
|
||||
|
||||
knownapks.writeifchanged()
|
||||
|
||||
# Generate latest apps HTML for widget
|
||||
|
Loading…
Reference in New Issue
Block a user