1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 08:55:18 +03:00

mkosi: Only reset file permissions when $SRCDIR is not a mountpoint

If $SRCDIR is mounted into the build image (via mkosi overrides),
let's not reset the permissions fo the source tree so as to not
modify the original files on the host.
This commit is contained in:
Daan De Meyer 2021-01-14 19:33:42 +01:00
parent d8434c523c
commit e2ebc406ac

View File

@ -9,8 +9,10 @@ set -e
# so the files keep those permissions, otherwise details of what umask
# was set at the time the git tree was cloned will leak all the way
# through. Also set umask explicitly during the build.
chmod -R u+w,go-w,a+rX .
umask 022
if ! mountpoint -q "$SRCDIR"; then
chmod -R u+w,go-w,a+rX .
umask 022
fi
# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it
# as out-of-tree build dir. Otherwise, let's make up our own builddir.