And its fixed already in https://anonscm.debian.org/cgit/pkg-ruby-extras/diaspora-ins...
It lacks "set -u" which is the first line of defense for this kind of bugs, much more robust than the "if [ -d ...".
Command lines lack proper shell quoting. If $diaspora_home ends up with a trailing space somehow, this will again end in a disaster.
I don't see the point of adding a "test -e".
It seems "rm -rf /var/cache/diaspora /var/log/diaspora" got lost, so these directories are no longer cleaned up after uninstall.