#!/bin/sh

# 10.0 == 1.x
# 10.1 == 5.x
# 10.2 == 6.x
# 10.3 == 7.x
# 10.4 == 8.x

# Get the OS revision
version=`sysctl -n kern.osrelease`
major=`echo $version | sed -e 's/\..*$//'`

# 10.3 or higher required for installation. 97 is a special installer code.
if [ $major -lt 7 ]; then
	exit 97
	fi

# Check for the existence of any of our receipts and Darwin 7 or less. If present,
# remove the previous receipts so that the (null) bug in the Installer prior to 10.4
# won't trigger. Set kReceiptPrefix to the longest common start of the receipt names
# available.
if [ $major -lt 8 ]; then
	rm -rf "/Library/Receipts/Diploma"*
	rm -rf "/Library/Receipts/Wimba Diploma"*
	fi

exit 0
