You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-admin/localepurge/files/localepurge-0.5.4-parentdir...

19 lines
657 B

--- a/localepurge
+++ b/localepurge
@@ -165,7 +165,14 @@
${ACTION} `find ${REMOVEPATH} -type f -o -type l`
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
- SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ # if symlink, REMOVEPATH could be removed
+ # check from parentdir then
+ if [ -d ${REMOVEPATH} ]; then
+ SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ else
+ SPACEAFTER=$(df -P ${REMOVEPATH%/*} | awk '{if ( NR==2 ) { print $3 }}')
+ fi
+
SPACESUM=$(($SPACEBEFORE - $SPACEAFTER))
if test $SPACESUM -gt 0 ; then