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"


-- 
Eli Schwartz
Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to