From eb33fcf1da683e31edd057ce6675c29c8278ba7a Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Wed, 8 Jan 2025 14:40:15 +0000
Subject: [PATCH] core/systemd to 257.2-1

---
 core/systemd/.SRCINFO | 18 +++++++++---------
 core/systemd/PKGBUILD | 18 ++++++++++++++----
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/core/systemd/.SRCINFO b/core/systemd/.SRCINFO
index ab2d1eb4b..71322f83f 100644
--- a/core/systemd/.SRCINFO
+++ b/core/systemd/.SRCINFO
@@ -1,5 +1,5 @@
 pkgbase = systemd
-	pkgver = 257.1
+	pkgver = 257.2
 	pkgrel = 1
 	url = https://www.github.com/systemd/systemd
 	arch = x86_64
@@ -54,7 +54,7 @@ pkgbase = systemd
 	makedepends = lib32-gcc-libs
 	makedepends = linux-headers
 	conflicts = mkinitcpio<38-1
-	source = git+https://github.com/systemd/systemd#tag=v257.1?signed
+	source = git+https://github.com/systemd/systemd#tag=v257.2?signed
 	source = 0001-Use-Arch-Linux-device-access-groups.patch
 	source = arch.conf
 	source = loader.conf
@@ -76,7 +76,7 @@ pkgbase = systemd
 	validpgpkeys = A9EA9081724FFAE0484C35A1A81CEA22BC8C7E2E
 	validpgpkeys = 9A774DB5DB996C154EBBFBFDA0099A18E29326E1
 	validpgpkeys = 5C251B5FC54EB2F80F407AAAC54CA336CFEB557E
-	sha512sums = 53b14cfadf301a44fdfcaa2fe4b9d2371c85581544093b88e5afcee4e45c5bd8668aaae9dd6663363c24f3b610f9b0d6eb61f00df71d588bce8f6264424203e4
+	sha512sums = 60e09576738abf1d328d06daae8981780a9a4facc5b09e2a3ae24b8461e23d3be2a192a2261ec0e85f004a89eb77e76c4483b268f3d4d918146baf5b201fa49d
 	sha512sums = 78065bde708118b7d6e4ed492e096c763e4679a1c54bd98750d5d609d8cc2f1373023f308880f14fc923ae7f9fea34824917ef884c0f996b1f43d08ef022c0fb
 	sha512sums = 61032d29241b74a0f28446f8cf1be0e8ec46d0847a61dadb2a4f096e8686d5f57fe5c72bcf386003f6520bc4b5856c32d63bf3efe7eb0bc0deefc9f68159e648
 	sha512sums = c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5
@@ -102,7 +102,7 @@ pkgname = systemd
 	license = CC0-1.0
 	license = GPL-2.0-or-later
 	license = MIT-0
-	depends = systemd-libs=257.1
+	depends = systemd-libs=257.2
 	depends = acl
 	depends = libacl.so
 	depends = bash
@@ -150,8 +150,8 @@ pkgname = systemd
 	optdepends = libp11-kit: support PKCS#11
 	optdepends = tpm2-tss: unlocking LUKS2 volumes with TPM2
 	provides = nss-myhostname
-	provides = systemd-tools=257.1
-	provides = udev=257.1
+	provides = systemd-tools=257.2
+	provides = udev=257.2
 	conflicts = nss-myhostname
 	conflicts = systemd-tools
 	conflicts = udev
@@ -196,19 +196,19 @@ pkgname = systemd-libs
 
 pkgname = systemd-resolvconf
 	pkgdesc = systemd resolvconf replacement (for use with systemd-resolved)
-	depends = systemd=257.1
+	depends = systemd=257.2
 	provides = openresolv
 	provides = resolvconf
 	conflicts = resolvconf
 
 pkgname = systemd-sysvcompat
 	pkgdesc = sysvinit compat for systemd
-	depends = systemd=257.1
+	depends = systemd=257.2
 	conflicts = sysvinit
 
 pkgname = systemd-ukify
 	pkgdesc = Combine kernel and initrd into a signed Unified Kernel Image
-	depends = systemd=257.1
+	depends = systemd=257.2
 	depends = binutils
 	depends = python-cryptography
 	depends = python-pefile
diff --git a/core/systemd/PKGBUILD b/core/systemd/PKGBUILD
index 37d8cabe3..b3615fdba 100644
--- a/core/systemd/PKGBUILD
+++ b/core/systemd/PKGBUILD
@@ -21,7 +21,7 @@ pkgname=('systemd'
          'systemd-resolvconf'
          'systemd-sysvcompat'
          'systemd-ukify')
-_tag='257.1'
+_tag='257.2'
 # Upstream versioning is incompatible with pacman's version comparisons, one
 # way or another. So we replace dashes and tildes with the empty string to
 # make sure pacman's version comparing does the right thing for rc versions:
@@ -65,7 +65,7 @@ source=("git+https://github.com/systemd/systemd#tag=v${_tag}?signed"
         '30-systemd-tmpfiles.hook'
         '30-systemd-udev-reload.hook'
         '30-systemd-update.hook')
-sha512sums=('53b14cfadf301a44fdfcaa2fe4b9d2371c85581544093b88e5afcee4e45c5bd8668aaae9dd6663363c24f3b610f9b0d6eb61f00df71d588bce8f6264424203e4'
+sha512sums=('60e09576738abf1d328d06daae8981780a9a4facc5b09e2a3ae24b8461e23d3be2a192a2261ec0e85f004a89eb77e76c4483b268f3d4d918146baf5b201fa49d'
             '78065bde708118b7d6e4ed492e096c763e4679a1c54bd98750d5d609d8cc2f1373023f308880f14fc923ae7f9fea34824917ef884c0f996b1f43d08ef022c0fb'
             '61032d29241b74a0f28446f8cf1be0e8ec46d0847a61dadb2a4f096e8686d5f57fe5c72bcf386003f6520bc4b5856c32d63bf3efe7eb0bc0deefc9f68159e648'
             'c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5'
@@ -89,6 +89,7 @@ _meson_vcs_tag='false'
 _meson_mode='release'
 _meson_compile=()
 _meson_install=()
+_systemd_src_dir="${pkgbase}"
 
 if ((_systemd_UPSTREAM)); then
   _meson_version="${pkgver}"
@@ -102,6 +103,15 @@ if ((_systemd_UPSTREAM)); then
   fi
 fi
 
+# Some heuristics to detect that we are building on OBS, with no network access. Skip
+# git verification, and use the OBS-provided tarball instead. The sources will be
+# unpacked by OBS in $package-$version/
+if [ -f /.build/build.dist ] && [ -d /usr/src/packages/SOURCES ] &&  [ -d /usr/src/packages/BUILD ] &&  [ -d /usr/src/packages/OTHER ]; then
+  source[0]="${pkgbase}-${pkgver}.tar.gz"
+  sha512sums[0]='SKIP'
+  _systemd_src_dir="${pkgbase}-${pkgver}"
+fi
+
 _backports=(
 )
 
@@ -109,7 +119,7 @@ _reverts=(
 )
 
 prepare() {
-  cd "${pkgbase}"
+  cd "${_systemd_src_dir}"
 
   local _c _l
   for _c in "${_backports[@]}"; do
@@ -189,7 +199,7 @@ build() {
     -Dsbat-distro-url="https://archlinuxarm.org/packages/${CARCH}/${pkgname}"
   )
 
-  arch-meson "${pkgbase}" build "${_meson_options[@]}" $MESON_EXTRA_CONFIGURE_OPTIONS
+  arch-meson "${_systemd_src_dir}" build "${_meson_options[@]}" $MESON_EXTRA_CONFIGURE_OPTIONS
 
   meson compile -C build "${_meson_compile[@]}"
 }