git_version_gen: Just print the version

This was needed because we #included it in C++, but now it's easier to
have just the version in there
This commit is contained in:
Fabian Boehm 2024-11-18 21:36:41 +01:00
parent 5abd0e46f5
commit 378dc9123a
2 changed files with 5 additions and 5 deletions

View file

@ -53,16 +53,16 @@ fi
if test -r "$FBVF" if test -r "$FBVF"
then then
VC=$(grep -v '^#' "$FBVF" | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//') VC=$(cat "$FBVF")
else else
VC="unset" VC="unset"
fi fi
# Maybe output the FBVF # Maybe output the FBVF
# It looks like FISH_BUILD_VERSION="2.7.1-621-ga2f065e6" # It looks like "2.7.1-621-ga2f065e6"
test "$VN" = "$VC" || { test "$VN" = "$VC" || {
echo >&2 "FISH_BUILD_VERSION=$VN" echo >&2 "$VN"
echo "FISH_BUILD_VERSION=\"$VN\"" >"$FBVF" echo "$VN" >"$FBVF"
} }
# Output the fish-build-version-witness.txt # Output the fish-build-version-witness.txt

View file

@ -106,7 +106,7 @@ configure_file(fish.pc.in fish.pc.noversion @ONLY)
add_custom_command(OUTPUT fish.pc add_custom_command(OUTPUT fish.pc
COMMAND sed '/Version/d' fish.pc.noversion > fish.pc COMMAND sed '/Version/d' fish.pc.noversion > fish.pc
COMMAND printf "Version: " >> fish.pc COMMAND printf "Version: " >> fish.pc
COMMAND sed 's/FISH_BUILD_VERSION=//\;s/\"//g' ${FBVF} >> fish.pc COMMAND cat ${FBVF} >> fish.pc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS CHECK-FISH-BUILD-VERSION-FILE ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion) DEPENDS CHECK-FISH-BUILD-VERSION-FILE ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion)