desktop: fix AppData unit testing when in RC+git code.

We still want the normal GIMP_RELEASE C macro to be set because the
whole development frame should have code behaving like release code, yet
only for the AppStream metadata testing, we want to allow a "TODO"
release date while in +git code.
This commit is contained in:
Jehan 2024-12-06 17:43:58 +09:00
parent e6ad3ad0cd
commit a18d347bf5
2 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,7 @@ if appstreamcli.found()
find_program('test-appdata.sh', required: true, dirs: [meson.current_source_dir()]),
env: [
'GIMP_TESTING_BUILDDIR=' + meson.current_build_dir(),
'GIMP_RELEASE=' + (release ? '1' : '0'),
'GIMP_RELEASE=' + (release and not gimp_rc_git ? '1' : '0'),
],
suite: 'desktop',
)

View File

@ -31,12 +31,14 @@ gimp_app_version_major = gimp_app_version_arr[0].to_int()
gimp_app_version_minor = gimp_app_version_arr[1].to_int()
gimp_app_micro_rc = gimp_app_version_arr[2].split('-')
gimp_app_version_micro = gimp_app_micro_rc[0].to_int()
gimp_rc_git = false
if gimp_app_micro_rc.length() > 1
if not gimp_app_micro_rc[1].startswith('RC')
error('Version format is: <major>.<minor>.<micro> with optional "-RC<num>" suffix and optional "+git".')
endif
if gimp_app_micro_rc[1].endswith('+git')
gimp_app_version_rc = gimp_app_micro_rc[1].substring(2, -4).to_int()
gimp_rc_git = true
else
gimp_app_version_rc = gimp_app_micro_rc[1].substring(2).to_int()
endif