diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-08-26 13:08:25 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-08-26 15:22:29 +0200 |
commit | caf5eb586afa1a71ed04a3442585536930b150c2 (patch) | |
tree | e2f3d03f66bddf7f45abc471af155ec9e21a1ebc /mkosi.images | |
parent | Merge pull request #34117 from yuwata/network-routing-policy-rule (diff) | |
download | systemd-caf5eb586afa1a71ed04a3442585536930b150c2.tar.xz systemd-caf5eb586afa1a71ed04a3442585536930b150c2.zip |
mkosi: Stop using git commit timestamps for package releases
This prevents bisecting to figure out which commit broke something
as when going backwards the git commit timestamp will be older meaning
package managers will refuse to upgrade to the "older" version. Let's
make sure the release is always newer by using the current date unless
$SOURCE_DATE_EPOCH is set.
Diffstat (limited to 'mkosi.images')
4 files changed, 4 insertions, 20 deletions
diff --git a/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot index 3ffde85f35..176f0b8869 100755 --- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot @@ -61,11 +61,7 @@ EOF # Linting the PKGBUILD takes multiple seconds every build so avoid that by nuking all the linting functions. rm /usr/share/makepkg/lint_pkgbuild/* -if [[ -d .git/ ]] && [[ -z "$(git status --porcelain)" ]]; then - TS="$(git show --no-patch --format=%ct HEAD)" -else - TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" -fi +TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" sed --in-place "pkg/$PKG_SUBDIR/PKGBUILD" \ --expression "s/^_tag=.*/_tag=$(cat meson.version)/" \ diff --git a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot index 466699c4fd..ce69aa33b7 100755 --- a/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/centos-fedora/mkosi.build.chroot @@ -9,11 +9,7 @@ if [[ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]]; then exit 1 fi -if [[ -d .git/ ]] && [[ -z "$(git status --porcelain)" ]]; then - TS="$(git show --no-patch --format=%ct HEAD)" -else - TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" -fi +TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" if [[ "$(rpm --eval "%{lua:print(rpm.vercmp('$(rpm --version | cut -d ' ' -f3)', '4.19.91'))}")" == "-1" ]]; then # Fix the %install override so debuginfo packages are generated even when --build-in-place is used. diff --git a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot index 03b3b049eb..0d33b10d6f 100755 --- a/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/debian-ubuntu/mkosi.build.chroot @@ -18,11 +18,7 @@ rm -rf "$SRCDIR"/debian/patches/* DEB_HOST_GNU_TYPE="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" mount --mkdir --bind "$BUILDDIR" "$SRCDIR/obj-$DEB_HOST_GNU_TYPE" -if [[ -d .git/ ]] && [[ -z "$(git status --porcelain)" ]]; then - TS="$(git show --no-patch --format=%ct HEAD)" -else - TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" -fi +TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" # Add a new changelog entry to update the version. We use a fixed date since a dynamic one causes a full # rebuild every time. diff --git a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot index a1fb83cdd9..173468f6c1 100755 --- a/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot +++ b/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot @@ -9,11 +9,7 @@ if [[ ! -f "pkg/$PKG_SUBDIR/systemd.spec" ]]; then exit 1 fi -if [[ -d .git/ ]] && [[ -z "$(git status --porcelain)" ]]; then - TS="$(git show --no-patch --format=%ct HEAD)" -else - TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" -fi +TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" # The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we # disable manpage compression as the files cannot be found. Fix the issue by removing the compression |