#!/bin/bash # this script sets this copy of depspec up on the system so you can run it # as `depspec` without completely installing it by using symlinks in # site-packages, /usr/local/bin and ~/.local/share/applications. # XXX: this might only work on linux, and even then you need sudo setup. SITE_PACKAGES="$(python -c "from distutils import sysconfig; print sysconfig.get_python_lib()")" remove_if_needed() { set +x if [ -e "$1" ]; then set -x sudo rm -i "$1" set +x # XXX: ugly, do I have to check again? if [ -e "$1" ]; then echo "$1 exists and can't remove, exiting" exit fi fi } remove_if_needed "${SITE_PACKAGES}/depspec" set -x sudo ln -s "$(pwd)/depspec" "${SITE_PACKAGES}/depspec" set +x remove_if_needed /usr/local/bin/depspec set -x sudo ln -s "$(pwd)/scripts/depspec" /usr/local/bin/depspec set +x remove_if_needed ~/.local/share/applications/depspec.desktop set -x sudo ln -s "$(pwd)/data/depspec.desktop" ~/.local/share/applications/depspec.desktop set +x