[pacman-dev] [PATCH] makepkg: replace sed in-place with built-in substitution
eschwartz at archlinux.org
Wed Nov 6 01:34:17 UTC 2019
On 11/5/19 8:28 PM, Eli Schwartz wrote:
> On 11/5/19 8:18 PM, Allan McRae wrote:
>> On 6/11/19 10:18 am, Ethan Sommer wrote:
>>> Read PKGBUILD into an array and replace the pkgver and pkgrel with
>>> bash parameter substitution, then use shell redirection to write to to
>>> the file. Because shell redirection follows symlinks, this accomplishes
>>> the same thing as the previous default of using the GNU-specific
>>> --follow-symlinks sed flag.
>>> Remove SEDPATH and SEDINPLACEFLAGS from the build systems as they are
>>> not used elsewhere.
>> I like the idea, but am concerned about unintended consequences...
>> I saw the following mentioned on IRC:
>> - potential for changed line endings
> You mean essentially dos2unix? The PKGBUILD would not be valid bash if
> it had the wrong type of line endings, bash would attempt to read lots
> of $'\r' as actual commands and stuff. That being said, a $'\r' in an
> embedded string could break, I suppose.
Turns out we even check for this.
if [[ $(<"$BUILDFILE") = *$'\r'* ]]; then
error "$(gettext "%s contains %s characters and cannot
be sourced.")" "$BUILDFILE" "CRLF"
Bug Wrangler and Trusted User
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1601 bytes
Desc: OpenPGP digital signature
More information about the pacman-dev