From 19ab706dac37932341aa743c982dd4cca9df4636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Sun, 10 Dec 2017 18:40:13 +0000 Subject: etc/build.usage, subr/build_args.subr: adds -C build[,dest[,src]] (clean subdirs) and -p (create package tarballs). subr/pkg_clean.subr: given -C, clean build, dest, and/or src. subr/pkg_install.subr: given -p, create gzip(1)-compressed package tarball at ${PKG_BASE_DIR}/${PKG_NAME}.tgz. vars/env.vars:${DEFAULT_BUILD_STEPS}: adds `clean' post-install. --- subr/pkg_clean.subr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 subr/pkg_clean.subr (limited to 'subr/pkg_clean.subr') diff --git a/subr/pkg_clean.subr b/subr/pkg_clean.subr new file mode 100644 index 00000000..d18adc13 --- /dev/null +++ b/subr/pkg_clean.subr @@ -0,0 +1,17 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_clean() { + local _dir; + for _dir in ${ARG_CLEAN_BUILDS}; do + case "${_dir}" in + build) ex_rtl_fileop rm "${PKG_BUILD_DIR}"; ;; + src) ex_rtl_fileop rm "${PKG_SUBDIR}"; ;; + dest) ex_rtl_fileop rm "${PKG_DESTDIR}"; ;; + *) return 1; ;; + esac; + done; +}; + +# vim:filetype=sh -- cgit v1.2.3