pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/install mk/install: Improve the strip-debug target.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/92c972cf91ca
branches:  trunk
changeset: 325223:92c972cf91ca
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon Nov 12 13:42:16 2018 +0000

description:
mk/install: Improve the strip-debug target.

Use the new strip-dbg tool, ensuring that we don't fail when the native strip
doesn't support -g.  Actually check for the existence of the output file
before trying to move it into place.  Add support for STRIP_FILES_SKIP for
certain files which should not be stripped.  And finally, improve performance
slightly by skipping symlinks.

diffstat:

 mk/install/install.mk |  26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diffs (40 lines):

diff -r 39c25482182e -r 92c972cf91ca mk/install/install.mk
--- a/mk/install/install.mk     Mon Nov 12 13:36:50 2018 +0000
+++ b/mk/install/install.mk     Mon Nov 12 13:42:16 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.72 2017/08/08 17:17:25 jlam Exp $
+# $NetBSD: install.mk,v 1.73 2018/11/12 13:42:16 jperkin Exp $
 #
 # This file provides the code for the "install" phase.
 #
@@ -338,16 +338,20 @@
 .PHONY: install-strip-debug
 install-strip-debug: plist
        @${STEP_MSG} "Automatic stripping of debug information"
-       ${RUN}${CAT} ${_PLIST_NOKEYWORDS} \
-       | ${SED} -e 's|^|${DESTDIR}${PREFIX}/|' \
-       | while read f; do \
-               tmp_f="$${f}.XXX"; \
-               if ${STRIP} -g -o "$${tmp_f}" "$${f}" 2> /dev/null; then \
-                       [ ! -f "$${f}" ] || \
-                           ${MV} "$${tmp_f}" "$${f}"; \
-               else \
-                       ${RM} -f "$${tmp_f}"; \
-               fi \
+       ${RUN}cd ${DESTDIR:Q}${PREFIX:Q};                               \
+       ${CAT} ${_PLIST_NOKEYWORDS} | while read f; do                  \
+               [ ! -h "$${f}" ] || continue;                           \
+               case "$${f}" in                                         \
+               ${STRIP_FILES_SKIP:@p@${p}) continue;;@}                \
+               *) ;;                                                   \
+               esac;                                                   \
+               tmp_f="$${f}.XXX";                                      \
+               if ${STRIP_DBG} -o "$${tmp_f}" "$${f}" 2>/dev/null; then \
+                       if [ -f "$${tmp_f}" -a -f "$${f}" ]; then       \
+                               ${MV} "$${tmp_f}" "$${f}";              \
+                       fi;                                             \
+               fi;                                                     \
+               ${RM} -f "$${tmp_f}";                                   \
        done
 
 ######################################################################



Home | Main Index | Thread Index | Old Index