Commit | Line | Data |
---|---|---|
059ec3d9 PH |
1 | /************************************************* |
2 | * Exim Monitor * | |
3 | *************************************************/ | |
4 | ||
f9ba5e22 | 5 | /* Copyright (c) University of Cambridge 1995 - 2018 */ |
1e1ddfac | 6 | /* Copyright (c) The Exim Maintainers 2020 */ |
059ec3d9 PH |
7 | /* See the file NOTICE for conditions of use and distribution. */ |
8 | ||
36eb5d3d JH |
9 | #define EM_VERSION_C |
10 | ||
059ec3d9 | 11 | #include "mytypes.h" |
e59797e3 | 12 | #include "store.h" |
059ec3d9 PH |
13 | #include "macros.h" |
14 | #include <string.h> | |
15 | #include <stdlib.h> | |
16 | ||
a6f7862b AM |
17 | #include "version.h" |
18 | ||
059ec3d9 PH |
19 | extern uschar *version_string; |
20 | extern uschar *version_date; | |
21 | ||
22 | void | |
23 | version_init(void) | |
24 | { | |
25 | int i = 0; | |
26 | uschar today[20]; | |
27 | ||
f3f065bb | 28 | version_string = US"2.06"; |
059ec3d9 | 29 | |
a6f7862b AM |
30 | #ifdef EXIM_BUILD_DATE_OVERRIDE |
31 | /* Reproducible build support; build tooling should have given us something looking like | |
32 | * "25-Feb-2017 20:15:40" in EXIM_BUILD_DATE_OVERRIDE based on $SOURCE_DATE_EPOCH in environ | |
33 | * per <https://reproducible-builds.org/specs/source-date-epoch/> | |
34 | */ | |
35 | version_date = US malloc(32); | |
36 | version_date[0] = 0; | |
37 | Ustrncat(version_date, EXIM_BUILD_DATE_OVERRIDE, 31); | |
38 | ||
39 | #else | |
f3ebb786 | 40 | Ustrcpy(today, US __DATE__); |
059ec3d9 PH |
41 | if (today[4] == ' ') i = 1; |
42 | today[3] = today[6] = '-'; | |
43 | ||
5903c6ff | 44 | version_date = US malloc(32); |
059ec3d9 PH |
45 | version_date[0] = 0; |
46 | Ustrncat(version_date, today+4+i, 3-i); | |
47 | Ustrncat(version_date, today, 4); | |
48 | Ustrncat(version_date, today+7, 4); | |
f3ebb786 JH |
49 | Ustrcat(version_date, US" "); |
50 | Ustrcat(version_date, US __TIME__); | |
a6f7862b | 51 | #endif |
059ec3d9 PH |
52 | } |
53 | ||
54 | /* End of em_version.c */ |