Commit a1ede4dd authored by Nezmer's avatar Nezmer Committed by Aaron Griffin
Browse files

devtools: make sure all files are owned by nobody before building



In makechrootpkg, build dirs are chowned to nobody before we move files
to "$uniondir/build". This could lead to failure If the files are
supposed to be dynamically upgraded when we run makepkg.

A common use-case is when we upgrade $pkgver in git,svn PKGBUILDS.

Signed-off-by: default avatarNezmer <Nezmer@allurelinux.org>
Signed-off-by: default avatarAaron Griffin <aaronmgriffin@gmail.com>
parent 7ce9cd69
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -167,10 +167,6 @@ if ! grep "SRCDEST=/srcdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
    echo "SRCDEST=/srcdest" >> "$uniondir/etc/makepkg.conf"
fi

chown -R nobody "$uniondir/build"
chown -R nobody "$uniondir/srcdest"
chown -R nobody "$uniondir/pkgdest"

# Copy PKGBUILD and sources
source PKGBUILD
cp PKGBUILD "$uniondir/build/"
@@ -201,6 +197,10 @@ if [ -f "ChangeLog" ]; then
    cp ChangeLog "$uniondir/build/"
fi

chown -R nobody "$uniondir/build"
chown -R nobody "$uniondir/srcdest"
chown -R nobody "$uniondir/pkgdest"

if ! grep "^nobody" "$uniondir/etc/sudoers" >/dev/null 2>&1; then
    echo "allowing 'nobody' sudo rights in the chroot"
    touch "$uniondir/etc/sudoers"