]> git.ipfire.org Git - thirdparty/git.git/commitdiff
build: sed portability fixes
authorJunio C Hamano <gitster@pobox.com>
Thu, 12 Jun 2025 17:04:58 +0000 (10:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Jun 2025 20:44:10 +0000 (13:44 -0700)
Recently generating the version-def.h file and the config-list.h
file have been updated, which broke versions of "sed" that do not
want to be fed a file that ends with an incomplete line, and/or that
do not understand the more recent "-E" option to use extended
regular expression.

Fix them in response to a build-failure reported on Solaris boxes.

cf. https://lore.kernel.org/git/09f954b8-d9c3-418f-ad4b-9cb9b063f4ae@comstyle.com/

Reported-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
GIT-VERSION-GEN
generate-configlist.sh

index b98159829898289a6e07fca4b019b13f6c7bfd74..b32cf928b7405252a58b50d236ecb6d35850a609 100755 (executable)
@@ -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|" \
index b06da53c8918196a465d4f37eb139274c549e044..f25cb9fc3efd93e71bf418025608355e3317c528 100755 (executable)
@@ -13,17 +13,17 @@ 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/^.*$/ "&",/;
        s/,  */",\n     "/g;
        p;};
-d' \
+       d' \
            "$SOURCE_DIR"/Documentation/*config.adoc \
-           "$SOURCE_DIR"/Documentation/config/*.adoc|
+           "$SOURCE_DIR"/Documentation/config/*.adoc |
        sort
        cat <<EOF
        NULL,