From owner-freebsd-ports@freebsd.org Sat Feb 22 17:29:26 2020 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DB3F245F7C for ; Sat, 22 Feb 2020 17:29:26 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48PwLG3FbHz4Z9h; Sat, 22 Feb 2020 17:29:26 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F1277006D88AAC2C7FB0A2B.dip0.t-ipconnect.de [IPv6:2003:cd:5f12:7700:6d88:aac2:c7fb:a2b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id C99E86189; Sat, 22 Feb 2020 17:29:25 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r358166 - head Cc: Mark Millard , Kevin Oberman , yasu@utahime.org References: <27EABC0F-6D78-47E1-810B-FAB282D430A3.ref@yahoo.com> <27EABC0F-6D78-47E1-810B-FAB282D430A3@yahoo.com> From: =?UTF-8?Q?Stefan_E=c3=9fer?= To: FreeBSD ports Message-ID: Date: Sat, 22 Feb 2020 18:29:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2020 17:29:26 -0000 Am 22.02.20 um 03:50 schrieb Mark Millard via freebsd-ports: > > > On 2020-Feb-21, at 15:59, Kevin Oberman wrote: > >> On Fri, Feb 21, 2020 at 8:38 AM Mark Millard via freebsd-ports wrote: >> Based on the example from https://www.freebsd.org/cgi/man.cgi?ldd >> there are commands such as the following that might help: >> >> . . . >> >> This can be a lot of files to go through (e.g., lib*) and so >> can take a fair amount of time. >> >> === >> Mark Millard >> marklmi at yahoo.com >> ( dsl-only.net went >> away in early 2018-Mar) >> >> You can feed that list into 'pkg which', awk that to remove all of the commands and then all but the last space delimited string of the remainder, and uniq. I also sorted. >> bison-3.5.2,1 >> gdbm-1.18.1_1 >> gettext-tools-0.20.1_1 >> gnuplot-5.2.8 >> llvm80-8.0.1_3 >> lua52-5.2.4 >> sqlite3-3.30.1,1 >> xterm-353_1 > > Cool. > > In the style of my prior examples (including the change that > found libedit and such), analogous would be: > > # find /usr/local/*bin* /usr/local/lib* -type f \ > | xargs -n1 file -F ' ' | grep 'ELF' | cut -f1 -d' ' \ > | xargs ldd -f '%A %p\n' 2>&1 | grep ncurses\.so\.8 | cut -f1 -d' ' \ > | xargs pkg which | cut -f6 -d' ' | sort -u | more > bison-3.5.2,1 > gdbm-1.18.1_1 > gettext-tools-0.20.1_1 > gnuplot-5.2.8 > libedit-3.1.20191211,1 > libtextstyle-0.20.1 > llvm10-10.0.0.r2 > llvm80-8.0.1_3 > lua52-5.2.4 > mesa-dri-18.3.2_9 > ruby-2.6.5,1 > sqlite3-3.30.1,1 > xterm-353_1 > > Looks like I'll be reasonably ready when I get to the point > of wanting to deal with this. While technically correct, the extra test for the ELF format of each single file is not required for correct results, AFAICT. The ldd command will just emit an error message for files it cannot process, and the error output is trivially suppressed. The following pipeline should only need a fraction of the time required by the one suggested above: # find /usr/local/*bin* /usr/local/lib* -type f \ | xargs ldd -f '%o %A\n' 2>/dev/null \ | grep ^libncurses\.so\.8 | cut -w -f2 \ | xargs pkg which -q | sort -u | more It completes in 13 seconds on my system, and I plan to add it to portmaster as another option to select the ports to be updated. The test of each file for ELF format requires one invocation of the file command for each, which leads to 217 seconds real time (178 user, 39 system) for me - so my version is faster by a factor of at least 15. Regards, STefan