#! /bin/sh
# preinst script for tkl
#
# see: dh_installdeb(1)
# cleaning up for old tklite installation


set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    install|upgrade)
	# automatically included by debhelper in prerm, 
        # but make explicitly sure in preinst
    ;;

    abort-upgrade)
	exit 0
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac


# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#


##############################################################################
# pacakge specific configuration
# enters only during install and upgrade


ask() {
	while : ; do
		echo -n "$1 "
		read a
		[ "$a" = "" ] && a="$2"
		a=`echo $a | tr A-Z a-z`
		[ "$a" = "y" -o "$a" = "n" ] && break
		echo
		echo "Illegal input!"
		echo
	done
}

cat <<END

IMPORTANT INSTALL NOTICE:
 
This release has sablotron dependencies changed to Index Data's own 
bug fixed version 1:1.0.2-4, which is conflicting with original Gingerall 
version 1.0.2 and debian version 1.0.2-4. A bug fixed sablotron 
version is available from our web site as tarball and as debian packages.  

The original 1.0.2 release has a bug which cripples XSLT handler 
arguments by applying unnecessary and unwanted mangling of handler arguments, 
and another which segfaults sablotron most unpleasently.

The full description of the bug is found on Sablotrons maillist
  http://archive.gingerall.cz/archives/public/sablot2004/msg00000.html

and the Gingerall bug report with patch is found at 
  http://bugzilla.gingerall.cz/show_bug.cgi?id=2811
  http://bugzilla.gingerall.cz/attachment.cgi?id=713&action=view

Unfortunately, the supplied patch which prevents unwanted mangling of 
Args/URI for user-defined scheme XSLT handler calls has not yet been 
accepted upstream. This forces any Keystone installation to use the patched
sablotron version 1:1.0.2-4 found at our web site.
  http://ftp.indexdata.dk/pub/sablotron/

The pached version will also shortly be available as debian package.

Furthermore, this Keystone release 1.5.5 has changed the admin XSLT handler 
calling code to work with our sablotron patch. All XSLT handler args are
modified from document('a-handler:xyz') to  document('a-handler:/xyz') 
(notice the slash) to avoid breaking by non-mangling.

Notice please that your own XSLT portal code needs to be changed the same 
way to be compliant with Keystone 1.5.5 and the patched Sablotron 1:1.0.1-2. 

Furthermore, similar changes have to be applied to XSLT include and import 
statements. For example
 <xsl:include href="tkl-file:some.xsl"/>
has to be changed to 
 <xsl:include href="tkl-file:/some.xsl"/>.

It is safe to apply these changes to portals running versions < 1.5.4 of 
Keystone, as the sablotron packages version 0.90 and 0.95 do not touch the 
argument list of handlers in case there is one single or a double slash 
present. 

END

ask "Should I continue installing Keystone version 1.5.5 [Y/n]? " "y"
if [ "$a" != "y" ]; then
    exit 1;
fi
