BuildSystem: Don't set symlink mode

Only call chmod if the file is not a symlink. Older versions of chmod
(shipped with ubuntu) don't support the -h flag.
This commit is contained in:
Bananymous 2025-10-02 17:05:20 +03:00
parent 73fb085a41
commit 84006e1e77
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ if sudo mount $ROOT_PARTITION $MOUNT_DIR; then
stat \"\$full\"
if [[ \${STAT[uid]} != \$uid ]] || [[ \${STAT[gid]} != \$gid ]] || [[ \${STAT[perms]} != \$mode ]]; then
chown -h \"\$uid:\$gid\" \"\$full\"
chmod -h \"\$mode\" \"\$full\"
test ! -h \"\$full\" && chmod \"\$mode\" \"\$full\"
fi
done <$BANAN_BUILD_DIR/sysroot-perms.txt
else
@ -63,7 +63,7 @@ if sudo mount $ROOT_PARTITION $MOUNT_DIR; then
full=\"$MOUNT_DIR/\$path\"
if [[ \$(stat -c '%u %g %a' \"\$full\") != \"\$uid \$gid \$mode\" ]]; then
chown -h \"\$uid:\$gid\" \"\$full\"
chmod -h \"\$mode\" \"\$full\"
test ! -h \"\$full\" && chmod \"\$mode\" \"\$full\"
fi
done <$BANAN_BUILD_DIR/sysroot-perms.txt
fi