Repository navigation
Expanded archives keep their original dates - #85
Merged
Merged
Conversation
Indexing the NeXTSTEP discs showed files with their 1990s dates but most directories dated the day the discs were built. Anything an archive does not date itself fell back to "now": - the folder an archive unpacks into (`pkg.tar.gz` -> `pkg/`), - implicit parents a tar lists only through `a/b/file`, - every member of a classic-Mac archive: `copy_into` never carried dates. Now, for every archive expansion and every target filesystem: - Undated directories take the archive file's own modification date (`Importer::implicit_dir_times`, `ensure_dir_at` takes a date). - Mac archive members keep their Mac dates: `CopyOptions::preserve_times`, on for archive expansion only, so `cp` / Commander still stamp the copy time. - `--expand-gunzip` output takes the original date recorded in the gzip header, else the .gz file's date. Directories and files that carry a date in the archive were already kept, and still are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unpack folders Two leftovers from rebuilding the NeXTSTEP discs with archive dates: - Tar members recorded with mtime 0 (four .nib files in MiscKit.2.0.5.s.gnutar.gz) still took the import day. They now take the archive file's date, like the archive's undated directories. - `.gnutar.gz`, `.gtar.gz`, `.gnutar` and `.gtar` were expanded (tar is detected by content) but not recognised as archive suffixes, so the unpack folder kept the whole name: `MiscKit.2.0.5.s.gnutar.gz/`. They now strip like `.tar.gz` (`MiscKit.2.0.5.s/`). `perms_applied` counted any non-empty override, so a member that carried only a date was reported as a permission applied. It now counts mode and owner only (`AttrOverrides::has_permissions`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an archive is expanded into an image (
--expand-archives,--expand-gunzip, on everyoptical newCD builder andrb-cli import), anything the archive does not date itself used to take the day of the import. Found while indexing a set of NeXTSTEP CDs: files had their 1990s dates, but 1,763 of 18,877 directories were dated the build day.Now, for every archive expansion and every target filesystem:
pkg.tar.gz->pkg/) and implicit parents a tar only lists througha/b/file(Importer::implicit_dir_times;ensure_dir_attakes a date)..sit,.cpt,.hqx, ...) keep their own Mac dates.copy_intonever carried dates;CopyOptions::preserve_timesturns that on for archive expansion only, sorb-cli cpand Commander Mode still stamp the time of the copy.--expand-gunzipoutput takes the original date in the gzip header, else the.gzfile's date.Entries that carry their own date in the archive already kept it, and still do.
Also
.gnutar.gz,.gtar.gz,.gnutarand.gtarare recognised when naming the unpack folder:MiscKit.2.0.5.s.gnutar.gz->MiscKit.2.0.5.s/(was the full file name).ImportStats::perms_appliedcounted any non-empty override, so a date alone was reported as a permission applied. It now counts mode and owner only (AttrOverrides::has_permissions).Testing
.gzfile's date;.gnutar/.gtarnames strip.scripts/preflight.shgreen:cargo test --release, MiSTer feature set, Rust 1.73 floor, doc parity, rb-regress.--expand-archives: all pass fsck with the same file / directory / symlink counts as before, directories dated the build day went from 1,763 to 0 apart from folders that come from the host tree itself, and files dated the build day went from 4 to 0.🤖 Generated with Claude Code