Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LukeShortCloud
Copy link
Collaborator

to prevent issues such as #2825

@LukeShortCloud LukeShortCloud self-assigned this Jul 19, 2025
@LukeShortCloud
Copy link
Collaborator Author

For testing purposes, I temporarily reverted b1613be and verified that this new code was triggered.

if find "${dir_tmp_local}"/bundle-libs/ -type l ! -exec test -e {} \; -print | grep bundle-libs
then echo "Broken symlinks found."
cd -
echo rm -r -f "${dir_tmp_local}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not comfortable with this. why testing the presence of "${dir_tmp_local}"/bundle-libs/ to then delete parent "${dir_tmp_local}"
What happens if "${dir_tmp_local}" is nothing or / for some reason? or even /tmp? That foldr should not be deleted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already do the same kind of deletion at the very end:

https://github.com/ptitSeb/box64/blob/v0.3.6/box64-bundle-x86-libs.sh#L96

This test lists out every file that has a broken symlink. We're basically aborting early if there are.

We set the ${dir_tmp_local} variable here:

https://github.com/ptitSeb/box64/blob/v0.3.6/box64-bundle-x86-libs.sh#L35

I suppose there could be an edge-case where mktemp is not available (although, the supported platforms for running this script - Arch Linux, Debian, and Fedora - all have this installed by default). When testing this PR, I did test with an empty ${dir_tmp_local} and rm -r -f did nothing.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough.

@ptitSeb ptitSeb merged commit 2d164c8 into ptitSeb:main Jul 19, 2025
@LukeShortCloud LukeShortCloud deleted the bundle-check-for-broken-symlinks branch July 19, 2025 17:59
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.

2 participants