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:
parent
4349108b68
commit
937272e967
6 changed files with 43 additions and 7 deletions
|
@ -57,7 +57,7 @@ purge_distfiles() {
|
|||
cur=0
|
||||
percent=-1
|
||||
for distfile in ${distfiles[@]}; do
|
||||
inode=$(stat "$distfile" --printf "%i")
|
||||
inode=$(stat_inode "$distfile")
|
||||
if [ -z "${inodes[$inode]}" ]; then
|
||||
inodes[$inode]="$distfile"
|
||||
else
|
||||
|
@ -77,7 +77,7 @@ purge_distfiles() {
|
|||
hash_distfile=${file##*/}
|
||||
hash=${hash_distfile:0:$HASHLEN}
|
||||
[ -n "${my_hashes[$hash]}" ] && continue
|
||||
inode=$(stat "$file" --printf "%i")
|
||||
inode=$(stat_inode "$file")
|
||||
echo "Obsolete $hash (inode: $inode)"
|
||||
( IFS="|"; for f in ${inodes[$inode]}; do rm -vf "$f"; rmdir "${f%/*}" 2>/dev/null; done )
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue