Skip to content

Commit

Permalink
Add a GDAL_RELEASE_NICKNAME define
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Feb 18, 2025
1 parent ca3cb8c commit fd315a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HOWTO-RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions gcore/gdal_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,8 @@ int CPL_STDCALL GDALWriteWorldFile(const char *pszBaseFilename,
* <li> "RELEASE_DATE": Returns GDAL_RELEASE_DATE formatted as a
* string. i.e. "20230312".</li>
* <li> "RELEASE_NAME": Returns the GDAL_RELEASE_NAME. ie. "3.6.3"</li>
* <li> "RELEASE_NICKNAME": (>= 3.11) Returns the GDAL_RELEASE_NICKNAME.
* i.e. "Trans rights are human rights"</li>
* <li> "--version": Returns one line version message suitable for
* use in response to --version requests. i.e. "GDAL 3.6.3, released
* 2023/03/12"</li>
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions gcore/gdal_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd315a7

Please sign in to comment.