Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2012 10:36:24 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-ports@freebsd.org
Subject:   Re: recent portrevision bump for libvpx
Message-ID:  <4F4CAE28.6020402@infracaninophile.co.uk>
In-Reply-To: <4F3E6601.9000405@infracaninophile.co.uk>
References:  <4F3E289D.9050605@FreeBSD.org> <4F3E2CED.90601@FreeBSD.org> <4F3E2E08.40007@FreeBSD.org> <4F3E451E.5070001@infracaninophile.co.uk> <4F3E507C.9080008@FreeBSD.org> <4F3E6601.9000405@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigBAE868C6D9C66E4332C7A21D
Content-Type: multipart/mixed; boundary="------------060201090909090507060807"

This is a multi-part message in MIME format.
--------------060201090909090507060807
Content-Type: text/plain; charset=x-viet-vps
Content-Transfer-Encoding: quoted-printable

On 17/02/2012 14:36, Matthew Seaman wrote:
> On 17/02/2012 13:05, Alex Dupre wrote:
>> Matthew Seaman wrote:
>>> Adding code to run ldd(1)
>>> against the files installed by the port and processing the results
>>> shouldn't be too hard.
>>
>> This could be an idea for ports maintainers, to verify if LIB_DEPENDS =
is
>> set correctly, but cannot be used as its generic replacement.
>=20
> Quite so, but that's not the principal benefit.  It's a way of
> efficiently answering the question "which of my installed ports need to=

> be re-built as a result of this shlib change?"  For the end users
> primarily.  Having this data recorded in /var/db/pkg/foo-9.99/+CONTENTS=

> makes answering that question something like:
>=20
> 	grep -l '@comment SHLIB:libwhatever' /var/db/pkg/*/+CONTENTS | \
> 	    cut -d '/' -f 5
>=20
> Ideally a ports management tool would notice if any port updated a shli=
b
> to a different ABI version and suggest to the user which ports to rebui=
ld.
>=20
> I assume something similar could be done for the new pkg tools, but I
> really have no idea how hard that would be.

Sorry about the delay, but I've finally got down to coding up my idea.
Apart from finding out that ldd(1) reacts quite badly to linux
executables (there's a patch for that problem in PR bin/127276) it all
seemed to work quite merrily.

Comments / criticism gratefully accepted.

The result is to add lines like so to the end of the +CONTENTS file
(this is from xterm-278):

[...]
@comment @unexec /usr/local/bin/update-desktop-database > /dev/null ||
/usr/bin/true
@comment SHLIB:libICE.so.6
@comment SHLIB:libSM.so.6
@comment SHLIB:libX11.so.6
@comment SHLIB:libXau.so.6
@comment SHLIB:libXaw7.so.7
@comment SHLIB:libXdmcp.so.6
@comment SHLIB:libXext.so.6
@comment SHLIB:libXft.so.2
@comment SHLIB:libXmu.so.6
@comment SHLIB:libXpm.so.4
@comment SHLIB:libXrender.so.1
@comment SHLIB:libXt.so.6
@comment SHLIB:libbz2.so.4
@comment SHLIB:libc.so.7
@comment SHLIB:libexpat.so.6
@comment SHLIB:libfontconfig.so.1
@comment SHLIB:libfreetype.so.9
@comment SHLIB:libncurses.so.8
@comment SHLIB:libpcre.so.1
@comment SHLIB:libpcreposix.so.0
@comment SHLIB:libpthread-stubs.so.0
@comment SHLIB:librpcsvc.so.5
@comment SHLIB:libutempter.so.0
@comment SHLIB:libxcb.so.2
@comment SHLIB:libz.so.5
@display +DISPLAY

Having rebuilt everything on my system with this patch applied, and
considering this notice in /usr/ports/UPDATING:

20120214:
  AFFECTS: users of devel/pcre
  AUTHOR: dougb@FreeBSD.org

  Until all dependent ports have been updated you should update pcre in
  a manner that will preserve its old shared library. For example:

  # portmaster -w devel/pcre
  or
  # portupgrade devel/pcre


I can now state with confidence that only the following ports would need
to be rebuilt on my system:

lucid-nonsense:/usr/ports:% grep -l '@comment SHLIB:libpcre.so'
/var/db/pkg/*/+CONTENTS | cut -d '/' -f 5
apache-2.2.22_5
avahi-app-0.6.29_1
dbus-glib-0.94
gamin-0.1.10_4
gio-fam-backend-2.28.8_1
glib-2.28.8_4
gobject-introspection-0.10.8_1
libslang2-2.2.4_1
maildrop-2.5.5_1
nmap-5.61.t4_1
pcre-8.30_1
php5-5.3.10_1
xterm-278

This change seems to sit happily with the current pkg tools -- it
survives pkg tarballs intact, and I haven't seen any problems in my
testing.  Of course, the time is utterly wonderful, given that the
bright new age of pkgng is almost upon us.  I'm still finding my way
around the pkgng sources, but my initial impression is that something
similar could be implemented without excessive difficulty.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW

--------------060201090909090507060807
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
	name="plist-shlib.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="plist-shlib.diff"

Index: bsd.port.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.706
diff -u -u -r1.706 bsd.port.mk
--- bsd.port.mk	22 Feb 2012 17:34:47 -0000	1.706
+++ bsd.port.mk	27 Feb 2012 17:21:45 -0000
@@ -4318,8 +4318,8 @@
 				install-desktop-entries install-license install-rc-script \
 				post-install post-install-script add-plist-info \
 				add-plist-docs add-plist-examples add-plist-data \
-				add-plist-post fix-plist-sequence compress-man \
-				install-ldconfig-file fake-pkg security-check
+				add-plist-post add-plist-shlibs fix-plist-sequence \
+				compress-man install-ldconfig-file fake-pkg security-check
 _PACKAGE_DEP=3D	install
 _PACKAGE_SEQ=3D	package-message pre-package pre-package-script \
 				do-package post-package-script
@@ -5859,6 +5859,29 @@
 .endif
 .endif
=20
+.if !target(add-plist-shlibs)
+add-plist-shlibs:
+# Record all of the shared libraries used by this port
+	@${ECHO_MSG} "=3D=3D=3D> Recording shared libraries used by ${PKGNAME}"=

+	-@${RM} -f ${WRKDIR}/.PLIST.shlibs ; \
+	for i in `${GREP} -v '^@' ${TMPPLIST}` ; do \
+		f=3D"${PREFIX}/$$i" ; \
+	    if [ ! -L $$f -a -f $$f ] ; then \
+			case `${FILE} $$f` in \
+				*GNU/Linux*) \
+					continue \
+					;; \
+				*) \
+	        		/usr/bin/ldd -f '%o\n' $$f 2>/dev/null \
+						>> ${WRKDIR}/.PLIST.shlibs ; \
+					;; \
+			esac ; \
+		fi ; \
+	done ; \
+	${SORT} -u < ${WRKDIR}/.PLIST.shlibs | \
+		${SED} -e 's,^,@comment SHLIB:,' >> ${TMPPLIST}
+.endif
+
 # Compress (or uncompress) and symlink manpages.
 .if !target(compress-man)
 compress-man:

--------------060201090909090507060807--

--------------enigBAE868C6D9C66E4332C7A21D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9MrjAACgkQ8Mjk52CukIzjvgCdHhUgLEmxZWBlmMA48+MWZ6fi
65MAnRmwtNhc4L26yrA73uAOPG+iK3b/
=Xlhr
-----END PGP SIGNATURE-----

--------------enigBAE868C6D9C66E4332C7A21D--



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