Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2008 08:48:45 +0300
From:      "Vladimir Chukharev" <Vladimir.Chukharev@tut.fi>
To:        "Doug Barton" <dougb@freebsd.org>
Cc:        Dirk Meyer <dirk.meyer@dinoex.sub.org>, freebsd-ports@freebsd.org
Subject:   Re: Mk/bsd.openssl.mk optimization
Message-ID:  <op.ue3brjk0pcmiy5@localhost>
In-Reply-To: <488F79F8.1030105@FreeBSD.org>
References:  <op.ueqfl1xy0g54sc@localhost> <08GlBzRclM@dmeyer.dinoex.sub.org> <op.ueumske80g54sc@localhost> <op.ueuwd8rs0g54sc@localhost> <488A0B2E.9070403@FreeBSD.org> <op.ue17xeex0g54sc@localhost> <op.ue2j4tv60g54sc@localhost> <488F79F8.1030105@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 29 Jul 2008 23:13:44 +0300, Doug Barton <dougb@freebsd.org> wrote:

> V.Chukharev wrote:
>> Another patch, just one line. It can be applied independently from the patch
>> for bsd.port.subdir.mk.
>
> I use: grep -l "@comment ORIGIN:${1}$" $pdb/*/+CONTENTS
> for similar purposes in portmaster with no complaints so far. Is there
> a reason you need to do the complicated thing?

I am a bit worried by the size of * expansion. I have about 1380 ports
installed, and this number can grow. One example of this kind limitation:
$ ls /usr/ports/*/* | wc
bash: /bin/ls: Argument list too long

That's the reason for find. And it is 5-30 times faster then grep -r
(depending on existence and size of /var/pkg/db/pkgdb.db).

As to the rest of the command - I do not want to mess with it yet. It works.

> Doug
>
>
>> =============
>> --- /usr/ports/Mk/bsd.openssl.mk.orig	2008-07-23 09:14:29.000000000 +0300
>> +++ /usr/ports/Mk/bsd.openssl.mk	2008-07-29 20:35:05.000000000 +0300
>> @@ -121,7 +121,7 @@
>>  	exists(${DESTDIR}/${LOCALBASE}/lib/libcrypto.so)
>>  # find installed port and use it for dependency
>>  PKG_DBDIR?=		${DESTDIR}/var/db/pkg
>> -OPENSSL_INSTALLED!=	grep -l -r "^lib/libssl.so." "${PKG_DBDIR}" | \
>> +OPENSSL_INSTALLED!=	find "${PKG_DBDIR}" -type f -name "+CONTENTS" -print0 | xargs -0 grep -l "^lib/libssl.so." | \
>>  			while read contents; do \
>>  				sslprefix=`grep "^@cwd " "$${contents}" | ${HEAD} -n 1`; \
>>  				if test "$${sslprefix}" = "@cwd ${LOCALBASE}" ; then \
>> =============
>>
>> Best regards,
>> Vladimir
>>
>
>



-- 
Vladimir Chukharev
Tampere University of Technology



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.ue3brjk0pcmiy5>