xbps-src: abstract away non-portable stat(1)

This implements semi-portable abstractions for both GNU and BSD
flavors of stat.
This commit is contained in:
q66 2023-09-11 04:30:55 +02:00 committed by Đoàn Trần Công Danh
parent 4349108b68
commit 937272e967
6 changed files with 43 additions and 7 deletions

View file

@ -253,7 +253,7 @@ hook() {
if [[ $cksum = $filesum ]]; then
dfgood=$((dfgood + 1))
else
inode=$(stat "$distfile" --printf "%i")
inode=$(stat_inode "$distfile")
msg_warn "$pkgver: wrong checksum found for ${curfile} - purging\n"
find ${XBPS_SRCDISTDIR} -inum ${inode} -delete -print
fi