Commit | Line | Data |
---|---|---|
420a0d19 CE |
1 | /************************************************* |
2 | * Exim Monitor * | |
3 | *************************************************/ | |
4 | ||
2ea97746 | 5 | /* Copyright (c) University of Cambridge 1995 - 2018 */ |
420a0d19 CE |
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 | ||
2ea97746 CE |
13 | #include "version.h" |
14 | ||
420a0d19 CE |
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 | ||
24 | version_string = US"2.06"; | |
25 | ||
2ea97746 CE |
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 | |
420a0d19 CE |
36 | Ustrcpy(today, __DATE__); |
37 | if (today[4] == ' ') i = 1; | |
38 | today[3] = today[6] = '-'; | |
39 | ||
2ea97746 | 40 | version_date = US malloc(32); |
420a0d19 CE |
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__); | |
2ea97746 | 47 | #endif |
420a0d19 CE |
48 | } |
49 | ||
50 | /* End of em_version.c */ |