tech-pkg archive

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

patch for REQUIRES



Hi guys,

I'd like to commit the following patch before the freeze, which I have been 
using locally for some time. It makes sure that libs provided in a package are 
not recorded in REQUIRES of the same package.

Without the patch, for instance 'expat' has /usr/lib/libexpat.so.1 (or whatever 
else 'ldd' resolved under the DESTDIR environment) recorded in its REQUIRES, 
even though the binary (xmlwf) is in fact linked against the package's own 
libexpat.so.1. Some other packages (ffmpeg, poco and some others I think) will 
even record libs with path starting with ${DESTDIR}${PREFIX}.

Objections?

-F

diff --git a/mk/pkgformat/pkg/metadata.mk b/mk/pkgformat/pkg/metadata.mk
index 2ef229c..0fc4f96 100644
--- a/mk/pkgformat/pkg/metadata.mk
+++ b/mk/pkgformat/pkg/metadata.mk
@@ -93,6 +93,11 @@ ${_BUILD_INFO_FILE}: plist
        done | ${SED} -e 's,^PROVIDES=${DESTDIR},PROVIDES=,'            \
                >> ${.TARGET}.tmp;                                      \
        for req in "" $$requires; do                                    \
+               stripreq=`${ECHO} $$req | ${AWK} '{gsub(/.*\//, "", $$0); 
print}'`; \
+               for i in "" $$libs; do                                  \
+                       striplib=`${ECHO} $$i | ${AWK} '{gsub(/.*\//, "", $$0); 
print}'`; \
+                       ${TEST} "$${stripreq}" != "$${striplib}" || req="";     
\
+               done;                                                   \
                ${TEST} "$$req" != "" || continue;                      \
                ${ECHO} "REQUIRES=$$req" >> ${.TARGET}.tmp;             \
        done



Home | Main Index | Thread Index | Old Index