fix: guard symlinks and grep-q in build_latest_perl.sh and build_imagick.sh#18
Merged
Merged
Conversation
build_latest_perl.sh: ln -s calls on lines 43–46 were unguarded — they fail with "File exists" on every re-run after initial provision. Guard each with [ -L target ] || ln -s ... matching the pattern from all other recipes. Also add mkdir -p /root/bin (was missing; ln -s would fail even on first run if /root/bin doesn't exist). build_imagick.sh: [ $(grep ...) ] is word-splitting on grep output — same pattern flagged in the DKIM records fix (PR #15). Replace with grep -q. Also change mkdir /tmp/imagick; /bin/true to mkdir -p. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
This one looks ok to me, taking out of draft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two idempotency/correctness fixes in the perl and imagick build scripts.
Why
build_latest_perl.sh: Fourln -scalls (lines 43–46) were unguarded. On any re-run after initial provision they fail with "File exists", aborting the script. Also:/root/binwas never created before the symlinks into it, so even the first run would fail if/root/bindidn't already exist.build_imagick.sh:[ $(grep "/usr/local/lib" /etc/ld.so.conf) ]uses the same word-splitting-on-grep-output pattern flagged in PR #15. If the line is found,$(grep ...)returns a path string that may contain spaces or appear multiple times — this is fragile and can silently misbehave depending on shell word-splitting.How
build_latest_perl.sh:[ -L target ] || ln -s ...guard on all four symlinks;mkdir -p /root/binbefore the symlinks into it. Matches the pattern used everywhere else in the codebase.build_imagick.sh:grep -q "/usr/local/lib" /etc/ld.so.conf || echo ...— clean idiom, no word-splitting. Also changedmkdir /tmp/imagick; /bin/truetomkdir -p /tmp/imagick.Testing
bash -npasses on both scripts. Changes are mechanical guards matching established patterns.