Closed iguessthislldo closed 6 years ago
I think I addressed all your comments, also I hope you didn't mind that I copy and pasted the fts loop from the rm function. It was tempting and I'm not super familiar with unix apis, but I hope to be.
Would be nice if this PR is accepted. Is there anything more what needs to be done?
Maybe a better solution would be to create a temporary directory inside ~/.tldrc/
instead of /tmp
so that there is no need to handle renaming between different file systems.
Yeah, that seems like a more elegant solution than my attempt to recreate cp -r. Maybe I should have brought this up as an issue first after all, but I was a little excited to make my first contribution to a open source project.
I went ahead and changed it to how you described.
I just realized that @LukasRypl isn't @Leandros... I'm sorry I keep jumping the gun on what I'm doing here. @Leandros when you get back to this, I'm happy to go with whatever, as long as the problem is fixed, because I like program.
Don't worry. I'll take a look as soon as I can.
I hit this error, as well.
While I wait for the fix to be released, what is the workaround?
For anybody landing here, this fixes the problem:
mkdir ~/.tldrc
cd ~/.tldrc
wget https://github.com/tldr-pages/tldr/archive/master.zip
unzip master.zip
rm master.zip
Script based on a cursory look at the code.
Above gets me working but does not fix the core issue. Eventually the app thinks the data is too old and I need to do the manual fix again.
@Leandros can this be merged please?
For anyone else looking for a good alternative, I've found https://github.com/dbrgn/tealdeer to be pretty sweet.
I haven't seen this PR. I wonder if we can merge it. 🤔
Hey @iguessthislldo! I realize that it's been a long time, but would you be interested in working with me to merge this PR? I'm a tldr-pages maintainer so I can do that ;)
@bl-ue I moved on to a different tldr client a long time ago, but it would be nice if my first ever PR was merged. Looks like I deleted my fork at some point though, so I can't just simply reopen it.... I will see if I can get it set back up if I have some time.
Any updates?
I originally started writing this as an issue I was going to open, but decided to look into it and found that I could fix it.
When using
tldr --update
, it exits with error code 1 and prints something likeError: Could Not Rename: /tmp/tldrqquWXv/tldr-master to /home/fred/.tldrc/tldr-master/
. I compiled from latest commit on Arch Linux. It was shows the message when querying a command for the first time, but it also shows the tldr page, and no error code. After .tldrc has been created it only shows it fortldr --update
.This happens because
rename()
has an EXDEV (cross device) error. It can't copy the updated pages from /tmp to home because Arch mounts /tmp using tmpfs by default. I changed it so that only whenrename()
has a EXDEV error, it falls back to a recursive copy instead.