purge-distfiles: fix rmdir parameter
This commit is contained in:
parent
15cf0d2e42
commit
6d90efebab
1 changed files with 6 additions and 2 deletions
|
@ -13,7 +13,7 @@ purge_distfiles() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Scann all templates for their current distfiles and checksums (hashes)
|
# Scan all templates for their current distfiles and checksums (hashes)
|
||||||
#
|
#
|
||||||
declare -A my_hashes
|
declare -A my_hashes
|
||||||
templates=(srcpkgs/*/template)
|
templates=(srcpkgs/*/template)
|
||||||
|
@ -54,6 +54,10 @@ purge_distfiles() {
|
||||||
declare -A inodes
|
declare -A inodes
|
||||||
distfiles=($XBPS_SRCDISTDIR/*/*)
|
distfiles=($XBPS_SRCDISTDIR/*/*)
|
||||||
max=${#distfiles[@]}
|
max=${#distfiles[@]}
|
||||||
|
if [ -z "$max" ]; then
|
||||||
|
msg_error "No distfiles files found in '$XBPS_SRCDISTDIR'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
cur=0
|
cur=0
|
||||||
percent=-1
|
percent=-1
|
||||||
for distfile in ${distfiles[@]}; do
|
for distfile in ${distfiles[@]}; do
|
||||||
|
@ -80,7 +84,7 @@ purge_distfiles() {
|
||||||
[ -n "${my_hashes[$hash]}" ] && continue
|
[ -n "${my_hashes[$hash]}" ] && continue
|
||||||
inode=$(stat "$file" --printf "%i")
|
inode=$(stat "$file" --printf "%i")
|
||||||
echo "Obsolete $hash (inode: $inode)"
|
echo "Obsolete $hash (inode: $inode)"
|
||||||
( IFS="|"; for f in ${inodes[$inode]}; do rm -v "$f"; rmdir ${f#/*} 2>/dev/null; done )
|
( IFS="|"; for f in ${inodes[$inode]}; do rm -v "$f"; rmdir "${f%/*}" 2>/dev/null; done )
|
||||||
done
|
done
|
||||||
echo "Done."
|
echo "Done."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue