Skip to content

Fix #85: Remove downloaded index files that hang around.

NOTE: Merge this after next stable. It isn't a particular problematic bug being fixed, and is not worthy of delaying the stable release.

If the download process is interrupted, a "dl-" file hangs around in F-Droid's cache directory. If the download succeeds, extracts an xml file from the downloaded .jar file, and then the rest of the process is interrupted, then a "index-*.xml" file hangs around in F-Droids files directory.

This fix removes these two types of left over files when F-Droid is started. In addition, it also makes it so that the downloaded repo indexes are now more clearly named "index--downloaded" (with no extension, because the code which does it doesn't know whether it is a .jar or .xml file, and it doesn't matter anyway). Also, it extracts the .xml files to the cache directory too (instead of the files dir) and names them "index--extracted.xml".

There is some code which removes the old "dl-" files that will become redundant after the first time it is executed on a users device after upgrading F-Droid. It is a very small amount of code run on startup, so I am not concerned about the performance implications of leaving it there, but I put a comment explaining that it can be removed in the future.

Includes minor formatting changes, and a few annotations.

Merge request reports