aboutsummaryrefslogtreecommitdiffstats
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2019-06-03 16:18:29 +0300
committerTimo Teräs <timo.teras@iki.fi>2019-06-03 16:19:17 +0300
commit1c47f374434aa66fb6620199fd027b96cee446e6 (patch)
tree3d0c4acc813efd5fd40a1b9d83d1be3e96037856 /src/apk.c
parent37fbafcd928c466c82c892a7868d686d710e5d07 (diff)
downloadaports-1c47f374434aa66fb6620199fd027b96cee446e6.tar.bz2
aports-1c47f374434aa66fb6620199fd027b96cee446e6.tar.xz
use fixed system time in test mode to have fixed test output
fixes test suite regression from previous commit
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index 2819281e16..069f4c0c36 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -47,6 +47,15 @@ static struct apk_string_array *test_repos;
char **apk_argv;
+time_t apk_time(void)
+{
+#ifdef TEST_MODE
+ return 1559567666;
+#else
+ return time(NULL);
+#endif
+}
+
static void version(void)
{
printf("apk-tools " APK_VERSION ", compiled for " APK_DEFAULT_ARCH ".\n"