Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2016 18:06:07 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r293777 - user/cperciva/freebsd-update-build/scripts
Message-ID:  <201601121806.u0CI67gI009531@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Jan 12 18:06:07 2016
New Revision: 293777
URL: https://svnweb.freebsd.org/changeset/base/293777

Log:
  Adjust script removing .orig files and empty files:
  - Adopt the regexp to cleaned patches, that don't have
    diff or subversion header.
  - Switch from awk to sed, due to bugs in awk regexps.

Modified:
  user/cperciva/freebsd-update-build/scripts/build.subr

Modified: user/cperciva/freebsd-update-build/scripts/build.subr
==============================================================================
--- user/cperciva/freebsd-update-build/scripts/build.subr	Tue Jan 12 16:38:09 2016	(r293776)
+++ user/cperciva/freebsd-update-build/scripts/build.subr	Tue Jan 12 18:06:07 2016	(r293777)
@@ -401,7 +401,8 @@ applypatches () {
 	while read PATCH; do
 		patch -p0 < ${PATCHDIR}/${PATCH}
 		# Remove ".orig" files created by patch(1) and empty files
-		for file in $(awk '$1 ~ /^(Index:|diff)/ { print $NF }' < \
+		for file in $(sed -Ene \
+		    's/^--- (.*)(\.orig$|[[:space:]]*)?/\1/p' < \
 		    ${PATCHDIR}/${PATCH}); do
 			echo ${file}.orig
 			if [ ! -s ${file} ]; then



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