Open
Description
lima/pkg/cidata/cidata.TEMPLATE.d/boot/40-install-containerd.sh
Lines 11 to 34 in ee32d35
Idea for optimization:
root@lima-default:/mnt/lima-cidata# gunzip -c nerdctl-full.tgz | head -c 512 | tar tv | awk '/ bin\/$/ {print $4}' 2022-03-03 root@lima-default:/mnt/lima-cidata# date -r /usr/local/bin/nerdctl "+%F" 2022-03-03Then do simple string comparison on the dates.
This relies on a tar header block being 512 bytes (so
tar
will not throw an error), andbin/
being the first entry in the tarball. I think these are reasonable assumptions, but am not totally sure. If the first line doesn't return a non-empty string, fall back on the expensive check by extracting the tarball.
Originally posted by @jandubois in #694 (comment)