From 9a7f68317aa652cbc89e7fa69381d6239a63a6e7 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 7 Dec 2008 21:14:32 +1000 Subject: makepkg: Introduce purge option The purge option, combined with the PURGE_TARGETS variable, allows makepkg to automatically remove commonly confliting or removed files (e.g. /usr/share/info/dir, *.pod). Original work: Tim Yang Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ef72dc25..66c68a54 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -41,7 +41,7 @@ confdir='@sysconfdir@' startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman') +packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') readonly -a packaging_options other_options @@ -717,6 +717,18 @@ tidy_install() { rm -rf ${DOC_DIRS[@]} fi + if [ "$(check_option purge)" = "y" -a -n "PURGE_TARGETS" ]; then + msg2 "$(gettext "Removing pugre targets...")" + local pt + for pt in "${PURGE_TARGETS[@]}"; do + if [ "${pt}" == "${pt//\/}" ]; then + find . -type f -name "${pt}" -exec rm -f -- '{}' \; + else + rm -f ${pt} + fi + done + fi + if [ "$(check_option zipman)" = "y" ]; then msg2 "$(gettext "Compressing man and info pages...")" local manpage ext file link hardlinks hl @@ -756,7 +768,6 @@ tidy_install() { done fi - if [ "$(check_option strip)" = "y" ]; then msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" local binary -- cgit v1.2.3