Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check empty cachedir for -d, --print-stats, --recover #612

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

gperciva
Copy link
Member

No description provided.

@gperciva
Copy link
Member Author

I'm not entirely sold on this. On one hand, it does the desired:

$ ./tarsnap --cachedir empty-cachedir/ -d -f tiny
tarsnap: Cache directory must already exist for -d; check --cachedir and/or run --fsck

On the other hand, it seems messy to #include "chunks.h" in bsdtar.c.

On the gripping hand, glue.c doesn't seem much better. And while I could certainly add functions to multitape etc. to pass the function call down the layers, that seems like overkill. Another option would be to move chunks_directory_exists() to a separate chunks_really_public.h, then only include that one in bsdtar.c.

So this seems to me like the least bad way to implement this, but I don't like it.

@gperciva gperciva force-pushed the check-empty-cachedir branch from d251c89 to b3c8074 Compare April 7, 2024 18:49
@gperciva gperciva force-pushed the check-empty-cachedir branch from b3c8074 to 7704062 Compare July 7, 2024 16:00
@gperciva gperciva force-pushed the check-empty-cachedir branch from 7704062 to 3459dc8 Compare July 30, 2024 22:46
@gperciva gperciva force-pushed the check-empty-cachedir branch from 3459dc8 to 5bc9396 Compare December 21, 2024 00:55
@cperciva cperciva merged commit 89642eb into master Jan 12, 2025
2 checks passed
@gperciva gperciva deleted the check-empty-cachedir branch January 12, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants