#!/bin/sh

if [ -z "${1}" ]; then
	echo "ERROR: No documentation path given."
	exit 1
fi

DOC_SUBDIR='../../desktopbsd-doc'
if [ -d "${DOC_SUBDIR}" ]; then
	cd "${DOC_SUBDIR}"

	# Remove old contents
	rm -rf ${1}
	mkdir -pm 755 ${1}

	# Exclude subversion directories, use root:wheel
	# as owner/group for copied files
	find . -not -path '*/.svn*' | cpio --quiet -pudmR 0:0 ${1}
else
	echo "WARNING: Documentation not found, skipping it."
fi

