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

feat: Add iOS, macOS, and BSD native support #251

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

brian6932
Copy link

I used this on a rootfully jailbroken iOS device. There are some differences with the paths in the documentation for Darwin based kernels that I had to resolve, but this at least makes it work.

@brian6932 brian6932 force-pushed the feat/ios-macos-bsd-support branch from a5290a4 to bffe2be Compare February 1, 2025 09:13
@brian6932 brian6932 force-pushed the feat/ios-macos-bsd-support branch from bffe2be to 0c8bc90 Compare February 1, 2025 09:22
@Lasall
Copy link
Collaborator

Lasall commented Feb 15, 2025

Are you running apt-fast on one of those systems?

@brian6932
Copy link
Author

brian6932 commented Feb 15, 2025

I used this on a rootfully jailbroken iOS device.

Yes.

Copy link
Collaborator

@Lasall Lasall left a comment

Choose a reason for hiding this comment

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

Pretty cool stuff and thank you for the provided fix. Is shlock available on your system as well? Reading the documentation this might be the natural replacement for flock.

@@ -247,7 +254,11 @@ _create_lock()
# unlock and remove the lock file
_remove_lock()
{
flock -u "$LCK_FD" 2>/dev/null
if [ $KERNEL = 'Linux' ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if [ $KERNEL = 'Linux' ]; then
if [[ "$KERNEL" == 'Linux' ]]; then

Copy link
Author

@brian6932 brian6932 Feb 15, 2025

Choose a reason for hiding this comment

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

The suggestion's not POSIX compliant afaict.

Copy link
Collaborator

Choose a reason for hiding this comment

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

apt-fast uses some non-posix functionality (already isn´t posix compliant).

Copy link
Author

@brian6932 brian6932 Feb 16, 2025

Choose a reason for hiding this comment

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

Weird, but I don't really understand how this provides any benefits (I don't use bash and other posix shells normally/willingly).

Co-authored-by: Dominique Lasserre <[email protected]>
Copy link
Author

@brian6932 brian6932 left a comment

Choose a reason for hiding this comment

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

Will look into shlock.

@@ -247,7 +254,11 @@ _create_lock()
# unlock and remove the lock file
_remove_lock()
{
flock -u "$LCK_FD" 2>/dev/null
if [ $KERNEL = 'Linux' ]; then
Copy link
Author

@brian6932 brian6932 Feb 15, 2025

Choose a reason for hiding this comment

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

The suggestion's not POSIX compliant afaict.

@brian6932
Copy link
Author

brian6932 commented Feb 15, 2025

The only thing I'll mention's that root users can delete the lockfile when shlock's used, chflags uchg,schg prevents the root user from deleting the lockfile.

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