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