Page MenuHomeFreeBSD
Paste P215

Masterwork From Distant Lands
ArchivedPublic

Authored by dch on Aug 24 2018, 12:04 PM.
diff --git a/databases/couchdb2/Makefile b/databases/couchdb2/Makefile
index 760cd45ea98e..c235b4e2b368 100644
--- a/databases/couchdb2/Makefile
+++ b/databases/couchdb2/Makefile
@@ -93,7 +93,7 @@ pre-install:
post-install:
@${FIND} -E ${STAGEDIR} -type f \
- -name couchjs -o -name \*.so \
+ -regex '.+/(couchjs|.+.so)$$' \
-exec ${STRIP_CMD} {} +
@${MKDIR} \
${STAGEDIR}/var/db/${PORTNAME} \

Event Timeline

dch edited the content of this paste. (Show Details)Aug 24 2018, 12:04 PM
dch changed the title of this paste from untitled to Masterwork From Distant Lands.
dch added a comment.Aug 24 2018, 12:07 PM

unexpected behaviour of find between the -regex and the -name versions leads to couchjs not being stripped:

.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/b64url-1.0.1/priv/b64url.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/snappy-1.0.5/priv/snappy_nif.so:         ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
dch@akai /u/p/d/couchdb2> find -E /tmp/usr/ports/databases/couchdb2/work/stage -type f -name couchjs -o -name \*.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/bin/couchjs
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/khash-1.0.1/priv/khash.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/hyper-1.0/priv/hyper_carray.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_ejson_compare.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_icu_driver.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/jiffy-0.14.11/priv/jiffy.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/b64url-1.0.1/priv/b64url.so
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/snappy-1.0.5/priv/snappy_nif.so
dch@akai /u/p/d/couchdb2> find -E /tmp/usr/ports/databases/couchdb2/work/stage -type f -name couchjs -o -name \*.so -exec file \{\} +
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/khash-1.0.1/priv/khash.so:               ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/hyper-1.0/priv/hyper_carray.so:          ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_ejson_compare.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_icu_driver.so:    ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/jiffy-0.14.11/priv/jiffy.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/b64url-1.0.1/priv/b64url.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/snappy-1.0.5/priv/snappy_nif.so:         ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
dch@akai /u/p/d/couchdb2> find -E /tmp/usr/ports/databases/couchdb2/work/stage -type f  -regex '.+/(couchjs|.+.so)$' -exec file \{\} +
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/bin/couchjs:                                 ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.0 (1200077), FreeBSD-style, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/khash-1.0.1/priv/khash.so:               ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/hyper-1.0/priv/hyper_carray.so:          ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_ejson_compare.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/couch-2.2.0/priv/couch_icu_driver.so:    ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/jiffy-0.14.11/priv/jiffy.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/b64url-1.0.1/priv/b64url.so:             ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
/tmp/usr/ports/databases/couchdb2/work/stage/usr/local/libexec/couchdb2/lib/snappy-1.0.5/priv/snappy_nif.so:         ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped
dch@akai /u/p/d/couchdb2>
mat added a subscriber: mat.Aug 24 2018, 12:15 PM

This is because the first is parsed as:

( -type f AND -name couchjs ) OR  ( -name \*.so AND -exec file \{\} + )

and the second:

-type f AND -regex '.+/(couchjs|.+.so)$$' AND -exec file \{\} +

What you want is:

-type f ( -name couchjs -o -name \*.so ) -exec ${STRIP_CMD} {} +
dch archived this paste.Aug 24 2018, 10:18 PM