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

Fix logic error in save_file() #90

Closed
dadv opened this issue Apr 11, 2023 · 6 comments
Closed

Fix logic error in save_file() #90

dadv opened this issue Apr 11, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@dadv
Copy link

dadv commented Apr 11, 2023

Latest commit 8274df4 seems to be incomplete.

Recent import of llvm15 into FreeBSD source tree https://cgit.freebsd.org/src/commit/contrib/llvm-project/libcxx/include/__string?id=81ad626541db97eb356e2c1d4a20eb2a26a766ab changed contrib/llvm-project/libcxx/include/__string from plain file to a directory and gitup fails to repair or update local tree that pre-dates noted import with error:

save_file: write file failure /usr/src/contrib/llvm-project/libcxx/include/__string/char_traits.h: Not a directory

Attached patch fixes the problem. It verifies if last component of path containing file is really directory and removes it otherwise then recreates the path.
patch-gitup.c.txt

@johnmehr
Copy link
Owner

Does the error still happen with the last month's commit (8274df4)?

@dadv
Copy link
Author

dadv commented Apr 11, 2023

Does the error still happen with the last month's commit (8274df4)?

I used gitup from recent ports, so yes, still fails and the patch helps.

@johnmehr
Copy link
Owner

I haven't tagged the latest commit yet (sorry about that). Could you please clone the latest commit and give it a try? Thanks!

@dadv
Copy link
Author

dadv commented Apr 11, 2023

Ports version has it all, I checked source with my eyes. Also take a look:
https://cgit.freebsd.org/ports/commit/net/gitup/Makefile?id=a9247f5c853c62a702d42b2584853794c32946e9

johnmehr added a commit that referenced this issue Apr 17, 2023
@johnmehr johnmehr self-assigned this Apr 17, 2023
@johnmehr johnmehr added the bug Something isn't working label Apr 17, 2023
@johnmehr
Copy link
Owner

I didn't see that the ports tree got a revision bump and included the latest commit without me tagging a new version number (sorry for the confusion on my part and the extra work on yours).

Your patch is in and it should be fixed now. Thank you!

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 18, 2023
ChangeLog:
	Fix logic error in save_file()
	johnmehr/gitup#90

MFH:		2023Q2
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 18, 2023
ChangeLog:
	Fix logic error in save_file()
	johnmehr/gitup#90

MFH:		2023Q2
(cherry picked from commit a5ba35b)
@nunotexbsd
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants