summaryrefslogtreecommitdiffstats
path: root/tools/templates/core_pkg/base-nanobsd/metadir/+DEINSTALL
blob: 715125f5d465f8b431e39ccaac5bea3dcac1c32f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

if [ "${2}" != "DEINSTALL" ]; then
	exit 0
fi

echo "===> Keeping a copy of current version mtree"

# Check if there is a current mtree to be saved
if [ ! -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree ]; then
	echo "===> Current mtree file not found"
	exit 1
fi

[ -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous ] \
	&& rm -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous

cp -f /usr/local/share/%%PRODUCT_NAME%%/base.mtree \
	/usr/local/share/%%PRODUCT_NAME%%/base.mtree.previous

exit $?
OpenPOWER on IntegriCloud