Skip to content

optimize expand method

Alberto Pianon requested to merge ap/optimize-expand into master

metadata currently collected through the AlienPackage.expand() method (which requires to uncompress tar archives every time, and such archives sometimes are very huge and consume a lot of machine time) should be collected only when they are actually needed.

Currently there are three specific operations that consume a lot of machine time in the expand() method, but each of them is needed only at a specific stage:

  1. package file checksums check, which checks if the file checksums in the aliensrc.json file match the actual checksums of the package files: it should be done only once, when adding an alienpackage

  2. get internal archive checksums, which extracts files in an internal archive and calculate all checksums: it is needed only by the spdxalien command

  3. get internal archive rootfolder, which tries to find if an internal archive has a main/root folder inside: it is needed only by the upload command

So three boolean options are added to the expand() method, in order to trigger the above operations only when needed and save machine time

This MR solves #16 (closed)

Edited by Alberto Pianon

Merge request reports