summaryrefslogtreecommitdiffstats
path: root/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-10-28 21:12:19 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-10-29 11:28:47 +0100
commit7aea1c9e80f20a9bde573b88125a884b9a0ec79f (patch)
tree430ed21049c283f1b88212f3b93cc6f8796f98b4 /mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot
parentMerge pull request #34391 from poettering/dns-long-label-fix (diff)
downloadsystemd-7aea1c9e80f20a9bde573b88125a884b9a0ec79f.tar.xz
systemd-7aea1c9e80f20a9bde573b88125a884b9a0ec79f.zip
mkosi: Move copying packages to the output directory to the postinst script
Now that we have the mkosi.clangd script to run clangd from the mkosi build script, it becomes clear that doing cleanup with mkosi.clean has a big gap in that we always run the mkosi.clean script and thus we also run it when we run the mkosi.clangd script, causing the previously built packages to be removed when we run clangd without producing new ones. In mkosi we're improving the situation by only running clean scripts when we clean up the output directory and disallowing writing to the output directory from build scripts. Let's adapt systemd to these changes by moving the copying of packages to the output directory to the postinst script.
Diffstat (limited to 'mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot')
-rwxr-xr-xmkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot15
1 files changed, 7 insertions, 8 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 1e3a74f953..0267b3c876 100755
--- a/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot
+++ b/mkosi.images/build/mkosi.conf.d/arch/mkosi.build.chroot
@@ -68,6 +68,11 @@ sed --in-place "pkg/$PKG_SUBDIR/PKGBUILD" \
--expression "s/^_tag=.*/_tag=$(cat meson.version)/" \
--expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/"
+(
+ shopt -s nullglob
+ rm -f "$BUILDDIR"/*.pkg.tar
+)
+
# We get around makepkg's root check by setting EUID to something else.
# Linting the PKGBUILD takes multiple seconds every build so avoid that by nuking all the linting functions.
# shellcheck disable=SC2046
@@ -82,14 +87,8 @@ env --chdir="pkg/$PKG_SUBDIR" \
_systemd_UPSTREAM=1 \
_systemd_QUIET=$( ((MESON_VERBOSE)); echo $? ) \
BUILDDIR="$PWD/pkg/$PKG_SUBDIR" \
- PKGDEST="$OUTPUTDIR" \
+ PKGDEST="$BUILDDIR" \
PKGEXT=".pkg.tar" \
MESON_EXTRA_CONFIGURE_OPTIONS="$MKOSI_MESON_OPTIONS $MESON_OPTIONS"
-(
- shopt -s nullglob
- rm -f "$BUILDDIR"/*.pkg.tar
-)
-
-cp "$OUTPUTDIR"/*.pkg.tar "$PACKAGEDIR"
-cp "$OUTPUTDIR"/*.pkg.tar "$BUILDDIR"
+cp "$BUILDDIR"/*.pkg.tar "$PACKAGEDIR"