summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
blob: 285d258c6352dbe50f90916a5db379dd47cfb03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Having CLEAN_DATE come from the current date doesn't allow for build
reproducibility. Add the option of using SOURCE_DATE_EPOCH if set
which for OE, it will be.

Upstream-Status: Pending
RP 2021/2/2

Index: opkg-0.4.4/configure.ac
===================================================================
--- opkg-0.4.4.orig/configure.ac
+++ opkg-0.4.4/configure.ac
@@ -281,7 +281,12 @@ AC_FUNC_UTIME_NULL
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
 
-CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
+1607446883
+if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
+    CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d '\n'`
+else
+    CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
+fi
 
 AC_SUBST([CLEAN_DATE])