summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2008-12-07 21:14:32 +1000
committerDan McGee <dan@archlinux.org>2009-01-03 00:11:51 -0600
commit9a7f68317aa652cbc89e7fa69381d6239a63a6e7 (patch)
tree2d4d2173521e0ea0af71e6b63a14a0512aa56054 /scripts
parent774c252753c3c1717684bea234a497941aa864d7 (diff)
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 <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in15
1 files changed, 13 insertions, 2 deletions
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