From owner-svn-ports-all@FreeBSD.ORG Thu Oct 30 23:04:04 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D41441; Thu, 30 Oct 2014 23:04:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67FDF53; Thu, 30 Oct 2014 23:04:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9UN43jE005053; Thu, 30 Oct 2014 23:04:03 GMT (envelope-from marino@FreeBSD.org) Received: (from marino@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9UN43O0005052; Thu, 30 Oct 2014 23:04:03 GMT (envelope-from marino@FreeBSD.org) Message-Id: <201410302304.s9UN43O0005052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marino set sender to marino@FreeBSD.org using -f From: John Marino Date: Thu, 30 Oct 2014 23:04:03 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r371776 - head/Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 23:04:04 -0000 Author: marino Date: Thu Oct 30 23:04:03 2014 New Revision: 371776 URL: https://svnweb.freebsd.org/changeset/ports/371776 QAT: https://qat.redports.org/buildarchive/r371776/ Log: bsd.port.mk: Finish update to make makepatch A portion of this patch to upgrade makepatch was committed almost 2 months ago; this is the rest of it. It changes the directory separator to "_" and it will transform "_" in the filename to "__" to avoid ambiguous file names (e.g. A/B/C.c and A_B/C.c won't have the same patch name). The new logic will not rename an existing patch that used previously standard separators of "-", "+", or "__" in its name. It is desireable to avoid commits that only change the filename of the patch, so that's why existing filenames are re-used if previously legal. The diff command is also pass the -p argument for additional useful context. Differential Revision: https://reviews.freebsd.org/D582 Approved by: portmgr (bapt) Modified: head/Mk/bsd.port.mk Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Thu Oct 30 22:15:09 2014 (r371775) +++ head/Mk/bsd.port.mk Thu Oct 30 23:04:03 2014 (r371776) @@ -1147,21 +1147,39 @@ STRIPBIN= ${STRIP_CMD} .else -# Look for ${PATCH_WRKSRC}/.../*.orig files, and (re-)create -# ${FILEDIR}/patch-* files from them. +# Look for files named "*.orig" under ${PATCH_WRKSRC} and (re-)generate +# ${FILESDIR}/patch-* files from them. By popular demand, we currently +# use '_' (underscore) to replace path separators in patch file names. +# +# If a file name happens to contain character which is also a separator +# replacement character, it will be doubled in the resulting patch name. +# +# To minimize gratuitous patch renames, newly generated patches will be +# written under existing file names when they use any of the previously +# common path separators ([-+_]) or legacy double underscore (__). .if !target(makepatch) +PATCH_PATH_SEPARATOR= _ makepatch: @${MKDIR} ${FILESDIR} @(cd ${PATCH_WRKSRC}; \ - for f in `${FIND} . -type f -name '*.orig'`; do \ + for f in `${FIND} -s . -type f -name '*.orig'`; do \ ORIG=$${f#./}; \ NEW=$${ORIG%.orig}; \ cmp -s $${ORIG} $${NEW} && continue; \ - PATCH=`${ECHO} $${NEW} | ${SED} -e 's|/|__|g'`; \ + ! for _lps in `${ECHO} _ - + | ${SED} -e \ + 's|${PATCH_PATH_SEPARATOR}|__|'`; do \ + PATCH=`${ECHO} $${NEW} | ${SED} -e "s|/|$${_lps}|g"`; \ + test -f "${FILESDIR}/patch-$${PATCH}" && break; \ + done || ${ECHO} $${_SEEN} | ${GREP} -q /$${PATCH} && { \ + PATCH=`${ECHO} $${NEW} | ${SED} -e \ + 's|${PATCH_PATH_SEPARATOR}|&&|g' -e \ + 's|/|${PATCH_PATH_SEPARATOR}|g'`; \ + _SEEN=$${_SEEN}/$${PATCH}; \ + }; \ OUT=${FILESDIR}/patch-$${PATCH}; \ - ${ECHO} ${DIFF} -ud $${ORIG} $${NEW} '>' $${OUT}; \ - TZ=UTC ${DIFF} -ud $${ORIG} $${NEW} | ${SED} -e \ + ${ECHO} ${DIFF} -udp $${ORIG} $${NEW} '>' $${OUT}; \ + TZ=UTC ${DIFF} -udp $${ORIG} $${NEW} | ${SED} -e \ '/^---/s|\.[0-9]* +0000$$| UTC|' -e \ '/^+++/s|\([[:blank:]][-0-9:.+]*\)*$$||' \ > $${OUT} || ${TRUE}; \