summaryrefslogtreecommitdiff
path: root/lib/rpmts_internal.h
diff options
context:
space:
mode:
authorBenno Rice <benno.rice@oracle.com>2021-10-21 22:16:55 +1100
committerPanu Matilainen <pmatilai@redhat.com>2021-11-23 10:53:04 +0200
commit71456f2fc09900a027a33dc3d6d75c69a9b39488 (patch)
treef50b3edbb39c0099b83d73474c2b8e858ea234f5 /lib/rpmts_internal.h
parented9fccf7c0bf120e60c9ac875f9bf6f06b0fb549 (diff)
downloadrpm-71456f2fc09900a027a33dc3d6d75c69a9b39488.tar.gz
Allow an optional "override clock" for deterministic timestamps
When trying to achieve a fully reproducible build process for an OS image timestamps are a major source of variance. The RPM database contains two fields in package header records that are relevant here: - RPMTAG_INSTALLTIME which is an explicit timestamp indicating when the package was installed. - RPMTAG_INSTALLTID which is an opaque value represending the transaction ID under which a package was installed but in terms of internal implementation is also a timestamp. This change allows the presence of the SOURCE_DATE_EPOCH environment variable, commonly used to override timestamps in build systems, to institute an "override time" mode in which values for RPMTAG_INSTALLTID and RPMTAG_INSTALLTIME become predicatble.
Diffstat (limited to 'lib/rpmts_internal.h')
-rw-r--r--lib/rpmts_internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h
index e69ef2584..fc6e15883 100644
--- a/lib/rpmts_internal.h
+++ b/lib/rpmts_internal.h
@@ -91,6 +91,8 @@ struct rpmts_s {
rpmtriggers trigs2run; /*!< Transaction file triggers */
int min_writes; /*!< macro minimize_writes used */
+
+ time_t overrideTime; /*!< Time value used when overriding system clock. */
};
#ifdef __cplusplus
@@ -131,6 +133,9 @@ rpmRC runScript(rpmts ts, rpmte te, Header h, ARGV_const_t prefixes,
RPM_GNUC_INTERNAL
int rpmtsNotifyChange(rpmts ts, int event, rpmte te, rpmte other);
+RPM_GNUC_INTERNAL
+rpm_time_t rpmtsGetTime(rpmts ts, time_t step);
+
#ifdef __cplusplus
}
#endif