LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File reproducible.patch of Package kbuild (Project home:bmwiedemann:reproducible:test)

Index: kbuild-0.1.9998svn2814/src/kmk/function.c
===================================================================
--- kbuild-0.1.9998svn2814.orig/src/kmk/function.c
+++ kbuild-0.1.9998svn2814/src/kmk/function.c
@@ -4308,7 +4308,9 @@ func_date (char *o, char **argv, const c
   else
     {
       time_t tval;
-      time (&tval);
+      const char *source_date_epoch;
+      if ((source_date_epoch = getenv("SOURCE_DATE_EPOCH")) == NULL || (tval = (time_t)strtol(source_date_epoch, NULL, 10)) <= 0)
+        time (&tval);
       if (!strcmp (funcname, "date-utc"))
         t = *gmtime (&tval);
       else