Progeny42 / refrapt

Tool to create local Debian mirrors using Python
GNU General Public License v3.0
34 stars 5 forks source link

[BUG] Runs occurring after test mode don't process files #18

Closed Progeny42 closed 2 years ago

Progeny42 commented 2 years ago

Describe the bug Test mode is designed to process all files, but skips downloading the new files identified (bulk of the processing), copying the Skel files to the Mirror directory, and prevents cleaning.

Index files are always downloaded (Step 2), regardless of the mode, in order to simulate actually performing the processing. Due to the mechanism Refrapt uses to prevent parsing packages that are already up-to date, if any already exist on the machine, they are timestamped (at the end of Source.ParseReleaseFiles()). After the download of Index files occurs, if the timestamp remains the same, the package is marked as Unmodified, and Refrapt ignores it. What this means is that running Test mode updates the /Skel directory with the latest Index files, and then all subsequent runs of Refrapt ignore all packages because the timestamp on disk matches the download timestamp. This would only be solved by a new file being available on a remote repository, or the deletion of the /Skel directory.

Proposed Resolution To ensure consistent behaviour, when in Test mode, all files downloaded in Steps 1 and 2 must be removed from the /Skel directory in Step 5. This will mean the files will always be marked as modified in a following run of Refrapt, meaning normal processing will ensue.