From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 10 07:40:00 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D39D46F5 for ; Mon, 10 Feb 2014 07:40:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A43931D5C for ; Mon, 10 Feb 2014 07:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1A7e0HC009989 for ; Mon, 10 Feb 2014 07:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1A7e04H009988; Mon, 10 Feb 2014 07:40:00 GMT (envelope-from gnats) Resent-Date: Mon, 10 Feb 2014 07:40:00 GMT Resent-Message-Id: <201402100740.s1A7e04H009988@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marcus von Appen 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 ESMTPS id 0F995651; Mon, 10 Feb 2014 07:34:14 +0000 (UTC) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.38]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 916981D2B; Mon, 10 Feb 2014 07:34:13 +0000 (UTC) Received: from [89.182.11.154] (helo=medusa.sysfault.org) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1WClMW-0004bL-I7; Mon, 10 Feb 2014 08:33:04 +0100 Received: from localhost ([127.0.0.1] helo=medusa.sysfault.org) by medusa.sysfault.org with esmtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WClMX-0002eI-Fn; Mon, 10 Feb 2014 08:33:05 +0100 Received: (from marcus@localhost) by medusa.sysfault.org (8.14.7/8.14.7/Submit) id s1A7X53W010171; Mon, 10 Feb 2014 08:33:05 +0100 (CET) (envelope-from marcus) Message-Id: <201402100733.s1A7X53W010171@medusa.sysfault.org> Date: Mon, 10 Feb 2014 08:33:05 +0100 (CET) From: Marcus von Appen To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/186619: [Patch]: Fix symlink handling for uniquefiles USES Cc: portmgr@FreeBSD.org X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Marcus von Appen List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Feb 2014 07:40:00 -0000 >Number: 186619 >Category: ports >Synopsis: [Patch]: Fix symlink handling for uniquefiles USES >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 10 07:40:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Marcus von Appen >Release: FreeBSD 9.2-STABLE amd64 >Organization: >Environment: System: FreeBSD medusa.sysfault.org 9.2-STABLE FreeBSD 9.2-STABLE #14 r260254: Sat Jan 4 14:59:59 CET 2014 root@medusa.sysfault.org:/usr/obj/usr/src/sys/MEDUSA amd64 >Description: The uniquefiles USES does not handle symlinks to files, which do not point to a valid location. Since test -e only evaluates to true, if the symlink exists, symlinks within a stagedir pointing to ${PREFIX} would not be properly prefixed or suffixed. >How-To-Repeat: Several ports from the exp-run of ports/185947 suffer from that. >Fix: --- symlink_uniquefiles2.diff begins here --- Index: Mk/Uses/uniquefiles.mk =================================================================== --- Mk/Uses/uniquefiles.mk (revision 343443) +++ Mk/Uses/uniquefiles.mk (working copy) @@ -100,7 +100,7 @@ .if ${UNIQUE_DEFAULT_LINKS} == yes _DO_CONDITIONAL_SYMLINK= \ - if [ ! -e ${STAGEDIR}${PREFIX}/$${fname} ]; then \ + if [ ! -e ${STAGEDIR}${PREFIX}/$${fname} -a ! -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ ${ECHO_MSG} " $${newf} --> @$${fname}"; \ ${LN} -s ${PREFIX}/$${newf} ${STAGEDIR}${PREFIX}/$${fname}; \ ${ECHO_CMD} LINKED:$${newf}:$${fname} >> ${_UNIQUEPKGLIST}; \ @@ -116,7 +116,7 @@ .endif .for entry in ${UNIQUE_PREFIX_FILES} @fname=${entry}; \ - if [ -e ${STAGEDIR}${PREFIX}/$${fname} ]; then \ + if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ newf=$${fname%/*}/${UNIQUE_PREFIX}$${fname##*/} ; \ ${ECHO_MSG} " $${fname} --> $${newf}" ; \ ${MV} ${STAGEDIR}${PREFIX}/$${fname} ${STAGEDIR}${PREFIX}/$${newf}; \ @@ -129,7 +129,7 @@ .endfor .if ${UNIQUE_FIND_PREFIX_FILES} @for fname in `${UNIQUE_FIND_PREFIX_FILES}`; do \ - if [ -e ${STAGEDIR}${PREFIX}/$${fname} ]; then \ + if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ newf=$${fname%/*}/${UNIQUE_PREFIX}$${fname##*/} ; \ ${ECHO_MSG} " $${fname} --> $${newf}" ; \ ${MV} ${STAGEDIR}${PREFIX}/$${fname} ${STAGEDIR}${PREFIX}/$${newf}; \ @@ -147,7 +147,7 @@ .endif .for entry in ${UNIQUE_SUFFIX_FILES} @fname=${entry}; \ - if [ -e ${STAGEDIR}${PREFIX}/$${fname} ]; then \ + if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ newf=$${fname%/*}/$${fname##*/}${UNIQUE_SUFFIX}; \ ${ECHO_MSG} " $${fname} --> $${newf}"; \ ${MV} ${STAGEDIR}${PREFIX}/$${fname} ${STAGEDIR}${PREFIX}/$${newf}; \ @@ -160,7 +160,7 @@ .endfor .if ${UNIQUE_FIND_SUFFIX_FILES} @for fname in `${UNIQUE_FIND_SUFFIX_FILES}`; do \ - if [ -e ${STAGEDIR}${PREFIX}/$${fname} ]; then \ + if [ -e ${STAGEDIR}${PREFIX}/$${fname} -o -L ${STAGEDIR}${PREFIX}/$${fname} ]; then \ newf=$${fname%/*}/$${fname##*/}${UNIQUE_SUFFIX}; \ ${ECHO_MSG} " $${fname} --> $${newf}"; \ ${MV} ${STAGEDIR}${PREFIX}/$${fname} ${STAGEDIR}${PREFIX}/$${newf}; \ --- symlink_uniquefiles2.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: