On 8/11/19 12:50 PM, Klemens Nanni wrote:
On Sun, Aug 11, 2019 at 09:56:23AM -0400, Brian Callahan wrote:
There is this, found for example in games/polymorphable:
${INSTALL_DATA_DIR} ${PREFIX}/share/flare/mods/polymorphable
         cd ${WRKSRC} && find * -type d -exec ${INSTALL_DATA_DIR} \
                 "${PREFIX}/share/flare/mods/polymorphable/{}" \;
         cd ${WRKSRC} && find * -type f -exec ${INSTALL_DATA} \
                 "{}" "${PREFIX}/share/flare/mods/polymorphable/{}" \;
Which can be greatly simplified...

I have no intention to hijack this thread, but maybe the diff can show
one can install multiple directories and/or files under differnt
conditions while traversing the source tree only once.

No PLIST change.
OK?

Sure, but do you mind sweeping the tree for this do-install idiom? It's probably not in too many places these days, but it's certainly in more than just this one port.

~Brian


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/polymorphable/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile    12 Jul 2019 20:46:23 -0000      1.7
+++ Makefile    11 Aug 2019 16:10:08 -0000
@@ -17,15 +17,10 @@ RUN_DEPENDS =       games/flare
  NO_BUILD =    Yes
  NO_TEST =     Yes
-post-extract:
-       rm ${WRKSRC}/maps/{demo,test}.txt~
-       rm ${WRKSRC}/tilesetdefs/{lpc_ortho,tileset_lpc}.txt~
+MODDIR =       ${PREFIX}/share/flare/mods/polymorphable
do-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/share/flare/mods/polymorphable
-       cd ${WRKSRC} && find * -type d -exec ${INSTALL_DATA_DIR} \
-               "${PREFIX}/share/flare/mods/polymorphable/{}" \;
-       cd ${WRKSRC} && find * -type f -exec ${INSTALL_DATA} \
-               "{}" "${PREFIX}/share/flare/mods/polymorphable/{}" \;
+       cd ${WRKSRC} && find . -type d -exec ${INSTALL_DATA_DIR} ${MODDIR}/{} 
\; \
+           -o -type f ! -name \*.txt~ -exec ${INSTALL_DATA} {} ${MODDIR}/{} \;
.include <bsd.port.mk>

Reply via email to