From: Richard Levitte Date: Fri, 2 Dec 2022 05:59:58 +0000 (+0100) Subject: Fix treatment of BUILD_METADATA X-Git-Tag: openssl-3.2.0-alpha1~1620 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83a5bd80708adc6726deac390e405a7b50dec540;p=thirdparty%2Fopenssl.git Fix treatment of BUILD_METADATA According to documentation [^1], the BUILD_METADATA from VERSION.dat should be prefixed with a plus sign when used. It is given this treatment in Configure, but not in all other scripts that use VERSION.dat directly. This change fixes that. Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/19815) --- diff --git a/NOTES-NONSTOP.md b/NOTES-NONSTOP.md index 586fbabef00..627843babf3 100644 --- a/NOTES-NONSTOP.md +++ b/NOTES-NONSTOP.md @@ -186,6 +186,9 @@ following variables: if [ -n "$PRE_RELEASE_TAG" ]; then PRE_RELEASE_TAG="-$PRE_RELEASE_TAG" fi + if [ -n "$BUILD_METADATA" ]; then + BUILD_METADATA="+$BUILD_METADATA" + fi echo "$MAJOR.$MINOR.$PATCH$PRE_RELEASE_TAG$BUILD_METADATA" |\ sed -e 's/[-.+]/_/g' ) diff --git a/dev/release-aux/release-version-fn.sh b/dev/release-aux/release-version-fn.sh index e9e1ac38507..b924fad8c0c 100644 --- a/dev/release-aux/release-version-fn.sh +++ b/dev/release-aux/release-version-fn.sh @@ -54,6 +54,9 @@ get_version () { -e 's|^dev$|0|' \ -e 's|^alpha([0-9]+)(-(dev))?$|\1|' \ -e 's|^beta([0-9]+)(-(dev))?$|\1|' ) + _BUILD_METADATA='' + if [ -n "$PRE_RELEASE_TAG" ]; then _PRE_RELEASE_TAG="-${PRE_RELEASE_TAG}"; fi + if [ -n "$BUILD_METADATA" ]; then _BUILD_METADATA="+${BUILD_METADATA}"; fi } # $1 is one of "alpha", "beta", "final", "", or "minor" @@ -102,6 +105,7 @@ set_version () { PRE_RELEASE_TAG="$PRE_LABEL$PRE_NUM" ;; esac + if [ -n "$PRE_RELEASE_TAG" ]; then _PRE_RELEASE_TAG="-${PRE_RELEASE_TAG}"; fi cat > "$SOURCEDIR/VERSION.dat" < + +Extra build metadata to be used by anyone for their own purposes. + =item B This is normally empty in the git workspace, but should always have the diff --git a/util/mktar.sh b/util/mktar.sh index 06a1f92150a..353ff716d30 100755 --- a/util/mktar.sh +++ b/util/mktar.sh @@ -12,6 +12,7 @@ HERE=`dirname $0` . $HERE/../VERSION.dat if [ -n "$PRE_RELEASE_TAG" ]; then PRE_RELEASE_TAG=-$PRE_RELEASE_TAG; fi +if [ -n "$BUILD_METADATA" ]; then BUILD_METADATA=+$BUILD_METADATA; fi version=$MAJOR.$MINOR.$PATCH$PRE_RELEASE_TAG$BUILD_METADATA basename=openssl