Description: Make the build reproducible Author: Chris Lamb Bug-Debian: https://bugs.debian.org/946315 Last-Update: 2019-12-05 Forwarded: https://github.com/EddyRivasLab/infernal/pull/37 --- a/hmmer/src/p7_tophits.c +++ b/hmmer/src/p7_tophits.c @@ -2002,8 +2002,10 @@ p7_tophits_TabularTail(FILE *ofp, const if (fprintf(ofp, "# Query file: %s\n", (qfile == NULL) ? "[none]" : qfile) < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); if (fprintf(ofp, "# Target file: %s\n", (tfile == NULL) ? "[none]" : tfile) < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); if (fprintf(ofp, "# Option settings: %s\n", spoof_cmd) < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); - if (fprintf(ofp, "# Current dir: %s\n", (cwd == NULL) ? "[unknown]" : cwd) < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); - if (fprintf(ofp, "# Date: %s", timestamp) < 0) /* timestamp ends in \n */ ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); + if (getenv("SOURCE_DATE_EPOCH") != NULL) { + if (fprintf(ofp, "# Current dir: %s\n", (cwd == NULL) ? "[unknown]" : cwd) < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); + if (fprintf(ofp, "# Date: %s", timestamp) < 0) /* timestamp ends in \n */ ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); + } if (fprintf(ofp, "# [ok]\n") < 0) ESL_XEXCEPTION_SYS(eslEWRITE, "tabular output tail, write failed"); free(spoof_cmd); --- a/src/cm_tophits.c +++ b/src/cm_tophits.c @@ -2801,8 +2801,10 @@ cm_tophits_TabularTail(FILE *ofp, const fprintf(ofp, "# Query file: %s\n", (qfile == NULL) ? "[none]" : qfile); fprintf(ofp, "# Target file: %s\n", (tfile == NULL) ? "[none]" : tfile); fprintf(ofp, "# Option settings: %s\n", spoof_cmd); - fprintf(ofp, "# Current dir: %s\n", (cwd == NULL) ? "[unknown]" : cwd); - fprintf(ofp, "# Date: %s", timestamp); /* timestamp ends in \n */ + if (getenv("SOURCE_DATE_EPOCH") != NULL) { + fprintf(ofp, "# Current dir: %s\n", (cwd == NULL) ? "[unknown]" : cwd); + fprintf(ofp, "# Date: %s", timestamp); /* timestamp ends in \n */ + } fprintf(ofp, "# [ok]\n"); free(spoof_cmd);