Remove psl_builtin_compile_time() for reproducable builds

This commit is contained in:
Tim Rühsen 2016-01-01 15:44:24 +01:00
parent c699e3c441
commit cde5e53ea6
6 changed files with 0 additions and 31 deletions

View File

@ -19,7 +19,6 @@ psl_registrable_domain
psl_suffix_count
psl_suffix_exception_count
psl_suffix_wildcard_count
psl_builtin_compile_time
psl_builtin_file_time
psl_builtin_sha1sum
psl_builtin_filename

View File

@ -125,10 +125,6 @@ int
int
psl_suffix_wildcard_count(const psl_ctx_t *psl);
/* returns compilation time */
time_t
psl_builtin_compile_time(void);
/* returns mtime of PSL source file */
time_t
psl_builtin_file_time(void);

View File

@ -185,7 +185,6 @@ struct _psl_ctx_st {
/* if this source file is included by psl2c.c, provide empty builtin data */
static const unsigned char kDafsa[1];
static time_t _psl_file_time;
static time_t _psl_compile_time;
static int _psl_nsuffixes;
static int _psl_nexceptions;
static int _psl_nwildcards;
@ -1304,22 +1303,6 @@ int psl_suffix_wildcard_count(const psl_ctx_t *psl)
return 0;
}
/**
* psl_builtin_compile_time:
*
* This function returns the time when the Publix Suffix List has been compiled into C code (by psl2c).
*
* If the generation of built-in data has been disabled during compilation, 0 will be returned.
*
* Returns: time_t value or 0.
*
* Since: 0.1
*/
time_t psl_builtin_compile_time(void)
{
return _psl_compile_time;
}
/**
* psl_builtin_file_time:
*

View File

@ -283,10 +283,6 @@ int main(int argc, const char **argv)
st.st_mtime = 0;
fprintf(fpout, "static time_t _psl_file_time = %lu;\n", st.st_mtime);
if ((source_date_epoch = getenv("SOURCE_DATE_EPOCH")))
fprintf(fpout, "static time_t _psl_compile_time = %lu;\n", atol(source_date_epoch));
else
fprintf(fpout, "static time_t _psl_compile_time = %lu;\n", time(NULL));
fprintf(fpout, "static int _psl_nsuffixes = %d;\n", psl->nsuffixes);
fprintf(fpout, "static int _psl_nexceptions = %d;\n", psl->nexceptions);
fprintf(fpout, "static int _psl_nwildcards = %d;\n", psl->nwildcards);
@ -312,7 +308,6 @@ int main(int argc, const char **argv)
if ((fpout = fopen(argv[argpos + 1], "w"))) {
fprintf(fpout, "static const unsigned char kDafsa[1];\n");
fprintf(fpout, "static time_t _psl_file_time;\n");
fprintf(fpout, "static time_t _psl_compile_time;\n");
fprintf(fpout, "static int _psl_nsuffixes = 0;\n");
fprintf(fpout, "static int _psl_nexceptions = 0;\n");
fprintf(fpout, "static int _psl_nwildcards = 0;\n");

View File

@ -104,9 +104,6 @@ static void test_psl(void)
}
}
printf("psl_builtin_compile_time()=%ld\n", psl_builtin_compile_time());
psl_builtin_compile_time() == 0 ? failed++ : ok++;
printf("psl_builtin_file_time()=%ld\n", psl_builtin_file_time());
psl_builtin_file_time() == 0 ? failed++ : ok++;

View File

@ -211,7 +211,6 @@ int main(int argc, const char *const *argv)
printf("builtin exceptions: %d\n", psl_suffix_exception_count(psl));
printf("builtin wildcards: %d\n", psl_suffix_wildcard_count(psl));
printf("builtin filename: %s\n", psl_builtin_filename());
printf("builtin compile time: %ld (%s)\n", psl_builtin_compile_time(), time2str(psl_builtin_compile_time()));
printf("builtin file time: %ld (%s)\n", psl_builtin_file_time(), time2str(psl_builtin_file_time()));
printf("builtin SHA1 file hash: %s\n", psl_builtin_sha1sum());
printf("builtin outdated: %d\n", psl_builtin_outdated());