public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: quirin.gylstorff@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 6/8] repository: create isar-apt with a reproducible timestamp
Date: Thu, 20 Aug 2026 10:30:12 +0200	[thread overview]
Message-ID: <20260820083014.3377283-7-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260820083014.3377283-1-felix.moessbauer@siemens.com>

As this timestamp ends up in the "Date:" field of the release file, it
also ends up in our internal rootfs'. To make these reproducible, we
have to set this to a fixed date. As the date itself is completely
irrelevant and not part of the generated images, we just use 1h after
epoch (similar to our default changelog date, as 0 cannot be used).

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/repository.bbclass | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/meta/classes-recipe/repository.bbclass b/meta/classes-recipe/repository.bbclass
index ba2803ad..a2061100 100644
--- a/meta/classes-recipe/repository.bbclass
+++ b/meta/classes-recipe/repository.bbclass
@@ -10,6 +10,20 @@ def repo_expand_opt_fields(d, var):
         return ''
     return '\n'.join('{}: {}'.format(k, v) for k, v in f.items())
 
+# use a fixed but arbitrary date for the Release file to make it reproducible
+ISAR_APT_RELEASE_DATE = "3600"
+repo_set_release_date() {
+    local dir="$1"
+    local codename="$2"
+    local release="${dir}/dists/${codename}/Release"
+
+    [ "${dir}" = "${REPO_ISAR_DIR}/${DISTRO}" ] || return 0
+    [ -f "${release}" ] || return 0
+
+    sed -i -e "s/^Date: .*/Date: $(LC_ALL=C date -u -R -d @${ISAR_APT_RELEASE_DATE})/" \
+        "${release}"
+}
+
 repo_create() {
     local dir="$1"
     local dbdir="$2"
@@ -40,6 +54,7 @@ repo_create() {
     fi
     if [ ! -d "${dbdir}" ]; then
         reprepro -b "${dir}" --dbdir "${dbdir}" export "${codename}"
+        repo_set_release_date "${dir}" "${codename}"
     fi
 }
 
@@ -55,6 +70,7 @@ repo_add_srcpackage() {
     reprepro -b "${dir}" --dbdir "${dbdir}" -C main -S - -P source \
         includedsc "${codename}" \
         "$@"
+    repo_set_release_date "${dir}" "${codename}"
 }
 
 repo_add_packages() {
@@ -77,6 +93,7 @@ repo_add_packages() {
         fi
         reprepro -b "${dir}" --dbdir "${dbdir}" -C main ${prio_opt} \
             includedeb "${codename}" "${package}"
+        repo_set_release_date "${dir}" "${codename}"
     done
 }
 
@@ -92,6 +109,7 @@ repo_del_srcpackage() {
     reprepro -b "${dir}" --dbdir "${dbdir}" -A source \
         remove "${codename}" \
         "${packagename}"
+    repo_set_release_date "${dir}" "${codename}"
 }
 
 repo_del_package() {
@@ -108,6 +126,7 @@ repo_del_package() {
     reprepro -b "${dir}" --dbdir "${dbdir}" -C main \
         removefilter "${codename}" \
         'Package (= '${p}'), Architecture (= '${a}'), $PackageType (= deb)'
+    repo_set_release_date "${dir}" "${codename}"
 }
 
 repo_contains_package() {
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260820083014.3377283-7-felix.moessbauer%40siemens.com.

  parent reply	other threads:[~2026-08-20  8:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  8:30 [PATCH 0/8] Make all sstate artifacts reproducible 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 1/8] make bootstrap output reproducible 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 2/8] rootfs: fold do_rootfs_postprocess task into do_rootfs_install 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 3/8] rootfs: make tarring of sstate artifact reproducible 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 4/8] rootfs: split clean_package_cache command 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 5/8] rootfs: make file timestamps reproducible 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` 'Felix Moessbauer' via isar-users [this message]
2026-08-20  8:30 ` [PATCH 7/8] make our internal chroots bit-by-bit reproducible 'Felix Moessbauer' via isar-users
2026-08-20  8:30 ` [PATCH 8/8] rootfs: make capture of apt state " 'Felix Moessbauer' via isar-users

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260820083014.3377283-7-felix.moessbauer@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=quirin.gylstorff@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox