r10490: 27 Apr 2005 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / debian / preinst.template
index fba33ace3c764199034fc3f728d9264395335f78..e0b5f37034e51b0c1fbbd77b952c1870eb80d203 100755 (executable)
@@ -1,16 +1,18 @@
-#!/bin/bash
+#!/bin/sh
 # This is part of clsql program: 
 #    http://clsql.med-info.com
 #
 # Copyright (c) 2002 Kevin M. Rosenberg
 
+set -e
+
 pkg=%%
+dir=/usr/share/common-lisp/source/$pkg
 
 case "$1" in
     install|upgrade|abort-upgrade)
-       rm -rf /usr/share/common-lisp-source/${pkg}
-       rm -rf /usr/share/common-lisp-source/${pkg}-[0-9\.]+
-
+       test -h $dir && rm $dir 
+       rm -rf ${dir}-[0-9\.]*
        ;;
     *)
         echo "preinst called with unknown argument '$1'" >&2