summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2023-09-19 10:40:29 +0300
committerJohn Klug <john.klug@multitech.com>2023-09-19 11:24:57 -0500
commitc9cd49f1434d2c635af509a3f6709638a067624d (patch)
treea71650cb4701e2fc0d83adce7cd21e1cb31bf907
parent9ca6d3ba652cfd50138bab5b6dc64e9b0a4367d7 (diff)
downloadmeta-mlinux-c9cd49f1434d2c635af509a3f6709638a067624d.tar.gz
meta-mlinux-c9cd49f1434d2c635af509a3f6709638a067624d.tar.bz2
meta-mlinux-c9cd49f1434d2c635af509a3f6709638a067624d.zip
opkg: make install time from SOURCE_DATE_EPOCH env variable, if it is set
-rw-r--r--recipes-devtools/opkg/files/0005-make-install-time-from-SOURCE_DATE_EPOCH-if-it-is-se.patch31
-rw-r--r--recipes-devtools/opkg/opkg_%.bbappend3
2 files changed, 33 insertions, 1 deletions
diff --git a/recipes-devtools/opkg/files/0005-make-install-time-from-SOURCE_DATE_EPOCH-if-it-is-se.patch b/recipes-devtools/opkg/files/0005-make-install-time-from-SOURCE_DATE_EPOCH-if-it-is-se.patch
new file mode 100644
index 0000000..7362f97
--- /dev/null
+++ b/recipes-devtools/opkg/files/0005-make-install-time-from-SOURCE_DATE_EPOCH-if-it-is-se.patch
@@ -0,0 +1,31 @@
+From e7c7771fc3f4dbabd6245d35e09ddfce9a4ed641 Mon Sep 17 00:00:00 2001
+From: Serhii Voloshynov <serhii.voloshynov@globallogic.com>
+Date: Tue, 12 Sep 2023 10:11:55 +0300
+Subject: [PATCH] make install time from SOURCE_DATE_EPOCH, if it is set
+
+---
+ libopkg/opkg_install.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
+index 912a10e..fdf4a4d 100644
+--- a/libopkg/opkg_install.c
++++ b/libopkg/opkg_install.c
+@@ -1062,7 +1062,13 @@ int opkg_install_pkg(pkg_t * pkg)
+ if (old_pkg)
+ old_pkg->state_status = SS_NOT_INSTALLED;
+
+- time(&pkg->installed_time);
++ char *epoch = getenv("SOURCE_DATE_EPOCH");
++ if(epoch) {
++ pkg->installed_time = atoi(epoch);
++ } else {
++ time(&pkg->installed_time);
++ }
++
+
+ ab_pkg = pkg->parent;
+ if (ab_pkg)
+--
+2.25.1
+
diff --git a/recipes-devtools/opkg/opkg_%.bbappend b/recipes-devtools/opkg/opkg_%.bbappend
index 69c1427..6ada9ec 100644
--- a/recipes-devtools/opkg/opkg_%.bbappend
+++ b/recipes-devtools/opkg/opkg_%.bbappend
@@ -1,7 +1,8 @@
-PR .= ".mlinux3"
+PR .= ".mlinux4"
SRC_URI += " file://0003-opkg_conf-create-opkg.lock-in-run-lock-instead-of-run.patch \
file://0004-opkg-symlink.patch \
+ file://0005-make-install-time-from-SOURCE_DATE_EPOCH-if-it-is-se.patch \
file://modprobe \
"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"