Skip to content

duc.c: Create ~/.cache if needed#296

Open
licy183 wants to merge 1 commit intozevv:masterfrom
licy183:master
Open

duc.c: Create ~/.cache if needed#296
licy183 wants to merge 1 commit intozevv:masterfrom
licy183:master

Conversation

@licy183
Copy link
Copy Markdown

@licy183 licy183 commented Jul 26, 2022

If ~/.cache doesn't exist, some error will happen. See termux/termux-packages#11350 (comment).

@l8gravely
Copy link
Copy Markdown
Collaborator

I'd merge this, but you need to handle errors better. If the mkdir() call fails, duc needs to error our more gracefully. I like the idea, but it needs some more work.

And apologies for the delay, now that v1.5.0-rc1 is about to come out, it would be great if you could re-spin this to address these issues.

@jmtd
Copy link
Copy Markdown
Contributor

jmtd commented Apr 1, 2026

Erm, 5da92b8 causes duc to fatally exit if the mkdir fails, which occurs if the directory already exists...

@jmtd jmtd mentioned this pull request Apr 1, 2026
@l8gravely
Copy link
Copy Markdown
Collaborator

Exactly! You need to check if the directory exists, or run mkdir() and check the return properly. I've already pushed a possible fix for this, but my brain is mush tonight and I still need to test stuff better.

@jmtd
Copy link
Copy Markdown
Contributor

jmtd commented Apr 15, 2026

I raised PR #356 to fix this a couple of weeks ago. Edit: oh no I didn't, I only fixed the related issue of failing if ~/.cache/duc already exists.

@l8gravely
Copy link
Copy Markdown
Collaborator

l8gravely commented Apr 16, 2026 via email

@jmtd
Copy link
Copy Markdown
Contributor

jmtd commented Apr 16, 2026

And I looked at it and I had some comments on how it was done.

thanks! I missed wherever those comments are, because they aren’t on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants