hdf5/reproducible.patch

88 lines
2.6 KiB
Diff

Date: 2025-02-03
Author: Bernhard M. Wiedemann
Fix reproducible builds
by not including date + hostname
This can be dropped after we get upstream commit d4605919f970e2f84d00d802f1b01db1b98fafc6
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index af6c5cf..d5b866d 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -135,8 +135,6 @@ print_header(void)
{
time_t now = HDtime(NULL);
struct tm *tm = HDlocaltime(&now);
- char real_name[30];
- char host_name[256];
int i;
const char *s;
#ifdef H5_HAVE_GETPWUID
@@ -150,65 +148,12 @@ print_header(void)
This machine-generated source code contains\n\
information about the library build configuration\n";
- /*
- * The real name is the first item from the passwd gecos field.
- */
-#ifdef H5_HAVE_GETPWUID
- {
- size_t n;
- char *comma;
-
- if ((pwd = HDgetpwuid(HDgetuid()))) {
- if ((comma = HDstrchr(pwd->pw_gecos, ','))) {
- n = MIN(sizeof(real_name) - 1, (unsigned)(comma - pwd->pw_gecos));
- HDstrncpy(real_name, pwd->pw_gecos, n);
- real_name[n] = '\0';
- }
- else {
- HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name));
- real_name[sizeof(real_name) - 1] = '\0';
- }
- }
- else
- real_name[0] = '\0';
- }
-#else
- real_name[0] = '\0';
-#endif
-
- /*
- * The FQDM of this host or the empty string.
- */
-#ifdef H5_HAVE_GETHOSTNAME
- if (HDgethostname(host_name, sizeof(host_name)) < 0)
- host_name[0] = '\0';
-#else
- host_name[0] = '\0';
-#endif
-
/*
* The file header: warning, copyright notice, build information.
*/
fprintf(rawoutstream, "/* Generated automatically by H5make_libsettings -- do not edit */\n\n\n");
HDfputs(FileHeader, rawoutstream); /*the copyright notice--see top of this file */
- fprintf(rawoutstream, " *\n * Created:\t\t%s %2d, %4d\n", month_name[tm->tm_mon], tm->tm_mday,
- 1900 + tm->tm_year);
- if (pwd || real_name[0] || host_name[0]) {
- fprintf(rawoutstream, " *\t\t\t");
- if (real_name[0])
- fprintf(rawoutstream, "%s <", real_name);
-#ifdef H5_HAVE_GETPWUID
- if (pwd)
- HDfputs(pwd->pw_name, rawoutstream);
-#endif
- if (host_name[0])
- fprintf(rawoutstream, "@%s", host_name);
- if (real_name[0])
- fprintf(rawoutstream, ">");
- HDfputc('\n', rawoutstream);
- }
-
fprintf(rawoutstream, " *\n * Purpose:\t\t");
for (s = purpose; *s; s++) {