From a37a65eb47ae63e033d9c792bebdc402d5991f06 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 18 Mar 2025 23:00:08 +0100 Subject: [PATCH] Add a GDAL_RELEASE_NICKNAME define --- HOWTO-RELEASE | 3 +++ gcore/gdal_misc.cpp | 12 ++++++++---- gcore/gdal_version.h.in | 3 +++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/HOWTO-RELEASE b/HOWTO-RELEASE index 81b1bc871d17..dc39dea92af4 100644 --- a/HOWTO-RELEASE +++ b/HOWTO-RELEASE @@ -37,6 +37,9 @@ Process : (*NOT* gdal_version.h which is a generated file) Note: the format of GDAL_RELEASE_DATE should be YYYYMMDD. + Update the release nickname of GDAL_RELEASE_NICKNAME to whatever makes sense + to the release manager. + 3) Update two instances of year in CITATION file to the current year. 4) Update "version" and "date-released" in CITATION.cff (Note: the DOI does diff --git a/gcore/gdal_misc.cpp b/gcore/gdal_misc.cpp index 5159ccc90130..06ecf3d43eac 100644 --- a/gcore/gdal_misc.cpp +++ b/gcore/gdal_misc.cpp @@ -2836,6 +2836,8 @@ int CPL_STDCALL GDALWriteWorldFile(const char *pszBaseFilename, *
  • "RELEASE_DATE": Returns GDAL_RELEASE_DATE formatted as a * string. i.e. "20230312".
  • *
  • "RELEASE_NAME": Returns the GDAL_RELEASE_NAME. ie. "3.6.3"
  • + *
  • "RELEASE_NICKNAME": (>= 3.11) Returns the GDAL_RELEASE_NICKNAME. + * i.e. "Trans rights are human rights"
  • *
  • "--version": Returns one line version message suitable for * use in response to --version requests. i.e. "GDAL 3.6.3, released * 2023/03/12"
  • @@ -2999,12 +3001,14 @@ const char *CPL_STDCALL GDALVersionInfo(const char *pszRequest) osVersionInfo.Printf("%d", GDAL_RELEASE_DATE); else if (EQUAL(pszRequest, "RELEASE_NAME")) osVersionInfo.Printf(GDAL_RELEASE_NAME); + else if (EQUAL(pszRequest, "RELEASE_NICKNAME")) + osVersionInfo.Printf(GDAL_RELEASE_NICKNAME); else // --version { - osVersionInfo.Printf("GDAL %s, released %d/%02d/%02d", - GDAL_RELEASE_NAME, GDAL_RELEASE_DATE / 10000, - (GDAL_RELEASE_DATE % 10000) / 100, - GDAL_RELEASE_DATE % 100); + osVersionInfo.Printf( + "GDAL %s \"%s\", released %d/%02d/%02d", GDAL_RELEASE_NAME, + GDAL_RELEASE_NICKNAME, GDAL_RELEASE_DATE / 10000, + (GDAL_RELEASE_DATE % 10000) / 100, GDAL_RELEASE_DATE % 100); #if defined(__GNUC__) && !defined(__OPTIMIZE__) // Cf https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html // also true for CLang diff --git a/gcore/gdal_version.h.in b/gcore/gdal_version.h.in index 3173bb2a56b7..6cbd3885139f 100644 --- a/gcore/gdal_version.h.in +++ b/gcore/gdal_version.h.in @@ -28,4 +28,7 @@ #ifndef GDAL_RELEASE_NAME # define GDAL_RELEASE_NAME "3.11.0dev" #endif + +#define GDAL_RELEASE_NICKNAME "Trans rights are human rights" + #endif