With some archives, like /usr/src/linux-source-5.10.tar.xz in Debian, tar doesn't restore all the directory timestamps from the extracted archive. This is not an incremental archive, but the list of files were provided in input at the .tar creation in an order not compatible with the algorithm described at
https://www.gnu.org/software/tar/manual/html_node/Directory-Modification-Times-and-Permissions.html The tar option --delay-directory-restore fixes the issue. But this behavior should be the default. I don't see the point of the current default behavior, where the rule for timestamp restoration is a bit complex and non-intuitive. Directory-Modification-Times-and-Permissions.html suggests that it could be memory requirements: "This approach allows to correctly restore directory meta-information in the majority of cases, while keeping memory requirements sufficiently small." But I don't see why the --delay-directory-restore behavior would require much memory. For instance, in the /usr/src/linux-source-5.10.tar.xz example, which is an archive with many directories, storing all the directory information (without optimizations based on the tree sturcture), i.e. directory pathnames and timestamp, would take less than 300 KB: $ find linux-source-5.10 -type d | wc 4712 4712 214370 -- Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
