tech-pkg archive

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

Re: PROVIDES/REQUIRES detection incomplete



Hi,

Jeremy C. Reed wrote on 16/04/09 2:28:
(iMil reminded me of this.)

pkgsrc/mk/flavor/pkg/metadata.mk attempts to figure out libraries provides and required by packages to define PROVIDES and REQUIRES.

                libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \

This assumes library naming ends with a digit.

Here are some examples of some that do not:

/usr/pkg/lib/libpulsedsp.so

/usr/pkg/lib/libEterm-0.9.4.so

/usr/pkg/lib/libboost_wserialization-mt.so

/usr/pkg/lib/libdb4_cxx-4.7.so

(I have over 500 examples on one of my systems.)

These aren't registered as PROVIDES.

So here is my WRONG patch (which has only a little testing):

Index: mk/flavor/pkg/metadata.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/metadata.mk,v
retrieving revision 1.30
diff -u -r1.30 metadata.mk
--- mk/flavor/pkg/metadata.mk   21 May 2008 20:39:52 -0000      1.30
+++ mk/flavor/pkg/metadata.mk   16 Apr 2009 00:08:47 -0000
@@ -58,7 +58,7 @@
        bins=`${AWK} '/(^|\/)(bin|sbin|libexec)\// { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
        case ${OBJECT_FMT:Q}"" in                                     \
        ELF)                                                            \
-               libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
+               libs=`${AWK} '/(^|\/)lib\/lib.*\.so.*$$/ { print 
"${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS} | while read 
i ; do if ${TEST} ! -h $$i; then echo $$i ; fi ; done`; \
                if ${TEST} -n "$$bins" -o -n "$$libs"; then         \
                        requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == 
"=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \
                fi;                                                     \

Note that this will change results for packages that worked before, for example libXv before had:

-PROVIDES=/usr/pkg/lib/libXv.so.1
(which is a symlink)

But now has:

+PROVIDES=/usr/pkg/lib/libXv.so.1.0.0
(not a symlink)

I think a . (dot) is missing in the awk pattern used to set the libs shell variable. See how the linklibs shell variable is set a few lines latter, id ed
libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ ...
vs
linklibs=`${AWK} '/.*\.so\.[0-9\.]+$$/ ...

There may be a good reason for this, I do not see it though, but I have the feeling that is the 2 awk pattern are in sync the PROVIDES/REQUIRES problem toy describe could well be solved.

Cheers, Stoned.


Home | Main Index | Thread Index | Old Index