From owner-freebsd-stable@FreeBSD.ORG Sun Sep 8 07:09:40 2013 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 671A2A28 for ; Sun, 8 Sep 2013 07:09:40 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB5662D9C for ; Sun, 8 Sep 2013 07:09:39 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id u14so3971321lbd.26 for ; Sun, 08 Sep 2013 00:09:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=d4z8b9XA2Emr3l9fOzXqR5yIZAiBTUJuNHIITejWfa4=; b=Rcem8fn2oeZQ9p26RyVUDjE0YcnMDaW/bTyYARpp2WOqZXsM/y9w2ipE0ziYeZ7tNU E8Rix9d3AOkHAYajkbYQs4qVXreGVr+nmUjQ7EvxqDgH8e0ws8Cr11XyVi/Kh4O7JD/h JWbQOZTffhZz1CPAcnxHmw1z1BFCCMJ+V/MOjdS3QNvG7IoHZNnlH0TjojtOMdFws18D 2U8HoX7pji7U2KHYjHl5jE/t/43zTu4Ev/udaRE3z2RBzRZDmKCKA30oAsH/6F7hJPRE tfFC+yn5/2hqbiNrDWUYRMWpDoK+tAeEwpR/5m/gGRiR8tVNeXsUX7FNw5bQYwGejP8f QKZg== X-Gm-Message-State: ALoCoQlJAEF08KlWxA3GaesgDlPaN+DWuN9KCqSIgbO+70CV4pOP5T7MiX1krihd/L5aMyImnvvO MIME-Version: 1.0 X-Received: by 10.112.168.3 with SMTP id zs3mr10897234lbb.2.1378624172147; Sun, 08 Sep 2013 00:09:32 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.114.230.66 with HTTP; Sun, 8 Sep 2013 00:09:32 -0700 (PDT) Date: Sun, 8 Sep 2013 00:09:32 -0700 X-Google-Sender-Auth: 6OZPOMIpnTA_r_aJ8oOJ0wuzn7w Message-ID: Subject: Troubles with dependencies (file -L is broken?) From: Maxim Sobolev To: stable@freebsd.org, ports@freebsd.org, portmgr@freebsd.org Content-Type: multipart/mixed; boundary=001a11c33fe60f554c04e5d9f408 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 07:09:40 -0000 --001a11c33fe60f554c04e5d9f408 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I am trying to portupgrade my subversion and it keeps trying to install databases/db42 over already installed version (same version), missing the shared library dependency. Adding some debug into bsd.port.mk, I see: =3D=3D=3D> subversion-1.8.3 depends on package: libtool>=3D2.4 - found set -x; set -e ; for i in libdb-4.2.so:/usr/ports/databases/db42; do lib=3D${i%%:*} ; dir=3D${i#*:} ; target=3D"install"; depends_args=3D"";= echo -n "=3D=3D=3D> subversion-1.8.3 depends on shared library: ${lib}" ; fou= nd=3D0 ; dirs=3D"/lib /usr/lib /usr/local/lib `/bin/cat /usr/local/libdata/ldconfig/* 2>/dev/null || : `" ; for libdir in $dirs; do test -f ${libdir}/${lib} || continue; if [ -x /usr/bin/file ]; then [ `file -b -L --mime-type ${libdir}/${lib}` =3D "application/x-sharedlib" ] |= | continue ; fi ; found=3D1 ; echo " - found"; done ; if [ ${found} -eq = 0 ]; then echo " - not found"; echo "=3D=3D=3D> Verifying for $lib in $d= ir"; if [ ! -d "$dir" ] ; then echo " =3D> No directory for $lib. Skipping.."; else if [ -n "" -o -n "" ]; then subpkgfile=3D`(cd $dir; ma= ke $depends_args -V PKGFILE)`; subpkgname=3D${subpkgfile%-*} ; subpkgname=3D${subpkgname##*/} ; if [ -r "${subpkgfile}" -a "$target" =3D "install" ]; then echo "=3D=3D=3D> Installing existing package ${subpkgfile}"; if [ -n "" -a ${subpkgname} =3D "pkg" ]; then [ -d /usr/ports/devel/subversion/work ] || /bin/mkdir -p /usr/ports/devel/subversion/work ; /usr/bin/tar xf ${subpkgfile} -C /usr/ports/devel/subversion/work -s ",/.*/,,g" "*/pkg-static" ; /usr/ports/devel/subversion/work/pkg-static add ${subpkgfile}; /bin/rm -f /usr/ports/devel/subversion/work/pkg-static; else /usr/sbin/pkg_add ${subpkgfile}; fi; elif [ -n "" -a "${target}" =3D "install" ]; then ech= o "=3D=3D=3D> subversion-1.8.3 depends on package: ${subpkgfile} - not foun= d"; echo "=3D=3D=3D> USE_PACKAGE_DEPENDS_ONLY set - will not build from sourc= e"; exit 1; else (cd $dir; make -DINSTALLS_DEPENDS $target $depends_args) ; fi; else (cd $dir; make -DINSTALLS_DEPENDS $target $depends_args) ; fi; echo "=3D=3D=3D> Returning to build of subversion-1.8.3"; fi ; fi ; do= ne + set -e + lib=3Dlibdb-4.2.so + dir=3D/usr/ports/databases/db42 + target=3Dinstall + depends_args=3D'' + echo -n '=3D=3D=3D> subversion-1.8.3 depends on shared library: libdb-4= .2.so' =3D=3D=3D> subversion-1.8.3 depends on shared library: libdb-4.2.so+ foun= d=3D0 + /bin/cat /usr/local/libdata/ldconfig/compat7x /usr/local/libdata/ldconfig/mysql /usr/local/libdata/ldconfig/portupgrade /usr/local/libdata/ldconfig/pth + dirs=3D'/lib /usr/lib /usr/local/lib /usr/local/lib/compat /usr/local/lib/mysql /usr/local/lib/compat/pkg /usr/local/lib/pth' + test -f /lib/libdb-4.2.so + continue + test -f /usr/lib/libdb-4.2.so + continue + test -f /usr/local/lib/libdb-4.2.so + [ -x /usr/bin/file ] + file -b -L --mime-type /usr/local/lib/libdb-4.2.so + [ inode/symlink =3D application/x-sharedlib ] + continue + test -f /usr/local/lib/compat/libdb-4.2.so + continue + test -f /usr/local/lib/mysql/libdb-4.2.so + continue + test -f /usr/local/lib/compat/pkg/libdb-4.2.so + continue + test -f /usr/local/lib/pth/libdb-4.2.so + continue + [ 0 -eq 0 ] + echo ' - not found' - not found + echo '=3D=3D=3D> Verifying for libdb-4.2.so in /usr/ports/databases/db= 42' =3D=3D=3D> Verifying for libdb-4.2.so in /usr/ports/databases/db42 So, file(1) call is the culprit here. Trying to reproduce in the console: [sobomax@pioneer ~]$ file -b -L --mime-type /usr/local/lib/libdb-4.2.so inode/symlink However: [sobomax@pioneer ~]$ hexdump -C /usr/local/lib/libdb-4.2.so | head -n 20 00000000 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00 |.ELF............| 00000010 03 00 3e 00 01 00 00 00 d0 40 02 00 00 00 00 00 |..>.....=D0=BF@......| 00000020 40 00 00 00 00 00 00 00 b8 a6 0e 00 00 00 00 00 |@.......=E2=95=A6=D1=96......| 00000030 00 00 00 00 40 00 38 00 05 00 40 00 1d 00 1a 00 |....@.8...@ .....| 00000040 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 dc 45 0e 00 00 00 00 00 dc 45 0e 00 00 00 00 00 |=D1=8DE......=D1=8DE......| 00000070 00 00 20 00 00 00 00 00 01 00 00 00 06 00 00 00 |.. .............| 00000080 00 50 0e 00 00 00 00 00 00 50 2e 00 00 00 00 00 |.P.......P......| 00000090 00 50 2e 00 00 00 00 00 fc 36 00 00 00 00 00 00 |.P......=D0=AD6......| 000000a0 d8 3a 00 00 00 00 00 00 00 00 20 00 00 00 00 00 |=D1=8C:.......= . .....| 000000b0 02 00 00 00 06 00 00 00 e8 54 0e 00 00 00 00 00 |........=D0=A5T......| 000000c0 e8 54 2e 00 00 00 00 00 e8 54 2e 00 00 00 00 00 |=D0=A5T......=D0=A5T......| 000000d0 a0 01 00 00 00 00 00 00 a0 01 00 00 00 00 00 00 |=E2=95=90.......=E2=95=90.......| 000000e0 08 00 00 00 00 00 00 00 50 e5 74 64 04 00 00 00 |........P=D0=95td....| 000000f0 5c 39 0d 00 00 00 00 00 5c 39 0d 00 00 00 00 00 |\9......\9......| 00000100 5c 39 0d 00 00 00 00 00 b4 34 00 00 00 00 00 00 |\9......=D0=844......| 00000110 b4 34 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |=D0=844..............| The culprit is that /usr/local/lib/libdb-4.2.so is a symlink to another symlink to another symlink etc, so that my guess is that file(1) stops at the first one. The issue can be resolved by using realpath(1), attached patch fixes it for me. [sobomax@pioneer ~]$ realpath /usr/local/lib/libdb-4.2.so /usr/local/lib/db42/libdb-4.2.so.2 [sobomax@pioneer ~]$ file -b -L --mime-type /usr/local/lib/db42/libdb-4.2.so.2 application/x-sharedlib [sobomax@pioneer ~]$ ls -l /usr/local/lib/libdb-4.2.so lrwxr-xr-x 1 root wheel 14 7 =D1=81=D0=B5=D0=BD 21:43 /usr/local/lib/li= bdb-4.2.so -> libdb-4.2.so.2 I am not sure what's the process to get bsd.port.mk adjusted these days. Should I open a PR and assign it to portmgr? -Maxim --001a11c33fe60f554c04e5d9f408 Content-Type: application/octet-stream; name="bsd.port.mk.diff" Content-Disposition: attachment; filename="bsd.port.mk.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hlbx6h7j0 LS0tIGJzZC5wb3J0Lm1rCTIwMTMvMDkvMDggMDc6MDQ6MjIJMS4xCisrKyBic2QucG9ydC5tawky MDEzLzA5LzA4IDA3OjA2OjAyCkBAIC01MDQ5LDcgKzUwNDksOCBAQAogCQlmb3IgbGliZGlyIGlu ICQkZGlyczsgZG8gXAogCQkJdGVzdCAtZiAkJHtsaWJkaXJ9LyQke2xpYn0gfHwgY29udGludWU7 IFwKIAkJCWlmIFsgLXggL3Vzci9iaW4vZmlsZSBdOyB0aGVuIFwKLQkJCQlbIGBmaWxlIC1iIC1M IC0tbWltZS10eXBlICQke2xpYmRpcn0vJCR7bGlifWAgPSAiYXBwbGljYXRpb24veC1zaGFyZWRs aWIiIF0gfHwgY29udGludWUgOyBcCisJCQkJX0xJQl9GSUxFPWByZWFscGF0aCAkJHtsaWJkaXJ9 LyQke2xpYn1gOyBcCisJCQkJWyBgZmlsZSAtYiAtTCAtLW1pbWUtdHlwZSAkJHtfTElCX0ZJTEV9 YCA9ICJhcHBsaWNhdGlvbi94LXNoYXJlZGxpYiIgXSB8fCBjb250aW51ZSA7IFwKIAkJCWZpIDsg XAogCQkJZm91bmQ9MSA7IFwKIAkJCSR7RUNIT19NU0d9ICIgLSBmb3VuZCI7IFwK --001a11c33fe60f554c04e5d9f408--