Subject: Re: Solaris sed

From: Collin Funk <[email-masked]>
Date: Wed, 11 Jun 2025 21:19:35 -0700

Brad Smith <[email-masked]> writes:

>> Totally untested patch follows.
>>
>>   GIT-VERSION-GEN        | 2 +-
>>   generate-configlist.sh | 8 ++++----
>>   2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git c/GIT-VERSION-GEN w/GIT-VERSION-GEN
>> index 208e91a17f..de989657fb 100755
>> --- c/GIT-VERSION-GEN
>> +++ w/GIT-VERSION-GEN
>> @@ -82,7 +82,7 @@ read GIT_MAJOR_VERSION GIT_MINOR_VERSION GIT_MICRO_VERSION GIT_PATCH_LEVEL trail
>>   $(echo "$GIT_VERSION" 0 0 0 0 | tr '.a-zA-Z-' ' ')
>>   EOF
>>   -REPLACED=$(printf "%s" "$INPUT" | sed -e
>> "s|@GIT_VERSION@|$GIT_VERSION|" \
>> +REPLACED=$(printf "%s\n" "$INPUT" | sed -e "s|@GIT_VERSION@|$GIT_VERSION|" \
>>   	-e "s|@GIT_MAJOR_VERSION@|$GIT_MAJOR_VERSION|" \
>>   	-e "s|@GIT_MINOR_VERSION@|$GIT_MINOR_VERSION|" \
>>   	-e "s|@GIT_MICRO_VERSION@|$GIT_MICRO_VERSION|" \
>> diff --git c/generate-configlist.sh w/generate-configlist.sh
>> index 9d2ad6165d..75c39ade20 100755
>> --- c/generate-configlist.sh
>> +++ w/generate-configlist.sh
>> @@ -13,16 +13,16 @@ print_config_list () {
>>   	cat <<EOF
>>   static const char *config_name_list[] = {
>>   EOF
>> -	sed -E '
>> -/^`?[a-zA-Z].*\..*`?::$/ {
>> +	sed -e '
>> +	/^`*[a-zA-Z].*\..*`*::$/ {
>>   	/deprecated/d;
>>   	s/::$//;
>>   	s/`//g;
>>   	s/^.*$/	"&",/;
>>   	p;};
>> -d' \
>> +	d' \
>>   	    "$SOURCE_DIR"/Documentation/*config.adoc \
>> -	    "$SOURCE_DIR"/Documentation/config/*.adoc|
>> +	    "$SOURCE_DIR"/Documentation/config/*.adoc |
>>   	sort
>>   	cat <<EOF
>>   	NULL,
>
>
> No errors or warnings after this is applied.

Likewise.

I checked on my Linux machine and both files are the same before and
after the patch. Before the patch on Solaris 10, the following is
generated:

    /* Automatically generated by generate-configlist.sh */

    static const char *config_name_list[] = {
            NULL,
    };

After the patch the output on Solaris is the same as on Linux.

So the patch is perfect.

Reviewed-by: Collin Funk <[email-masked]>

Collin