summaryrefslogtreecommitdiff
path: root/community/gnuradio/gnuradio.install
diff options
context:
space:
mode:
Diffstat (limited to 'community/gnuradio/gnuradio.install')
-rw-r--r--community/gnuradio/gnuradio.install49
1 files changed, 44 insertions, 5 deletions
diff --git a/community/gnuradio/gnuradio.install b/community/gnuradio/gnuradio.install
index e111ef946..1166dd05e 100644
--- a/community/gnuradio/gnuradio.install
+++ b/community/gnuradio/gnuradio.install
@@ -1,11 +1,50 @@
-post_install() {
+
+# clean up for anyone silly enough to run this as root
+
+# it would be great if pkgname and not just pkgver was passed in the arg list
+
+_pkg='gnuradio'
+_cpython='cpython-33'
+
+post_upgrade() {
+ while read _f; do
+ if [[ "${_f:(-3)}" != ".py" ]]; then
+ continue
+ fi
+ if [[ ! -f "$_f" ]]; then
+ continue
+ fi
+ if [[ -e "${_f}c" ]]; then
+ rm -f "${_f}c"
+ fi
+ if [[ -e "${_f}o" ]]; then
+ rm -f "${_f}o"
+ fi
+ _thisdir="$(dirname "$_f")/__pycache__"
+ if [[ ! -d "$_thisdir" ]]; then
+ continue
+ fi
+ _thisfile="$(basename "$_f")"
+ _thisfile="${_thisfile/%.py/.${_cpython}.py}"
+ if [[ -e "${_thisdir}/${_thisfile}c" ]]; then
+ rm -f "${_thisdir}/${_thisfile}c"
+ fi
+ if [[ -e "${_thisdir}/${_thisfile}o" ]]; then
+ rm -f "${_thisdir}/${_thisfile}o"
+ fi
+ # no good way to test for empty dir
+ # would be 25% faster if there were
+ rmdir --ignore-fail-on-non-empty "$_thisdir" &> /dev/null
+ done <<< "$(pacman -Qql $_pkg | grep '\.py$')"
+
update-desktop-database -q
}
-post_upgrade() {
- post_install
+post_install() {
+ post_upgrade $1
}
-post_remove() {
- post_install
+pre_remove() {
+ post_upgrade $1
}
+