containers / BuildSourceImage

Tool to build a source image based on an existing OCI image
GNU General Public License v2.0
29 stars 14 forks source link

Use extra-src archive checksum in filename #104

Open tkdchen opened 5 months ago

tkdchen commented 5 months ago

This PR proposes a new extra-src file name form.

There is a use case for source container images with extra sources. That is, after deduplicating sources between two images then merge them, same extra source tar archive names remain potentially.

For instance, image A has extra-src-[012].tar archive per layer and image B has extra-src-[01].tar archive per layer. When extra-src-1.tar of image B duplicates the extra-src-2.tar of image A and is removed, then after merging these two images, the final source image will have two layers including extra-src-0.tar.

As a result, if users extract the sources sequentially, previous extra-src-*.tar file may be overwritten.

This patch replaces the counter with checksum computed from the extra source archive to avoid such potential duplicate. It is convenient for manipulate sources by image layers directly without the need of adjusting the counter.