summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_setup_distclean.subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr/pkg_setup_distclean.subr')
-rw-r--r--subr/pkg_setup_distclean.subr12
1 files changed, 12 insertions, 0 deletions
diff --git a/subr/pkg_setup_distclean.subr b/subr/pkg_setup_distclean.subr
new file mode 100644
index 00000000..fc5999c8
--- /dev/null
+++ b/subr/pkg_setup_distclean.subr
@@ -0,0 +1,12 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_setup_distclean() {
+ if [ "$(stat -c %i "${PKG_BASE_DIR}")" \
+ != "$(stat -c %i "${WORKDIR}")" ]; then
+ build_fileop rm "${PKG_BASE_DIR}";
+ fi;
+};
+
+# vim:filetype=sh