#!/bin/sh

# .. bash wasted so much of my time finding this..
unset nullglob

case "$1" in
  configure)
    files=`ls /var/lib/dpkg/methods/http/Packages.* 2>/dev/null`
    if [ -n "$files" ] ; then
      echo "   The location and filenames of the dpkg-http archive have changed."
      echo "You may need to delete your old download directory."
      echo -n "There are Packages files from an old version of dpkg-http.  Delete [y/n]? "
      read ANSWER
      case "$ANSWER" in
	[yY]* )
	  rm /var/lib/dpkg/methods/http/Packages.*
	  ;;
      esac

      if [ -d /var/lib/dpkg/methods/http/debian ] ; then
	echo -n "Delete old debian/ directory [y/n]? "
	read ANSWER
	case "$ANSWER" in
	  [yY]* )
	    rm -rf /var/lib/dpkg/methods/http/debian
	    ;;
	esac
      fi
    fi
    ;;
esac

#DEBHELPER#
