################################################################################
#
# pkg_cleanup.cygpart - cygport cleanup functions
#
# Copyright (C) 2006-2020 Cygport authors
# Provided by the Cygwin project <https://cygwin.com/>
#
# cygport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cygport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cygport.  If not, see <https://www.gnu.org/licenses/>.
#
################################################################################

__finish() {
	local -i n=0;

	cd ${top};

	__step "Removing work directory in 2 seconds...";

	sleep 2 || exit $?;

	__step "Removing work directory NOW.";

	rm -rf ${workdir};

	__step "Finished.";
}

# protect functions
readonly -f __finish
