#v2.11 go through again and remove any empty dirs... #note, it is done above, but is incomplete. this should catch the rest... for ONEFILE in `cat ./$APKGNAME.files` do DELDIR="`dirname $ONEFILE`" [ -d $DELDIR ] && [ "`ls -1 $DELDIR`" = "" ] && rmdir $DELDIR #check one level up... but do not delete top dir, like /opt... DELLEVELS=`echo -n "$DELDIR" | sed -e 's/[^/]//g' | wc -c | sed -e 's/ //g'` if [ $DELLEVELS -gt 2 ];then DELDIR="`dirname $DELDIR`" [ -d $DELDIR ] && [ "`ls -1 $DELDIR`" = "" ] && rmdir $DELDIR fi done