svn commit: r293785 - user/cperciva/freebsd-update-build/scripts
Gleb Smirnoff
glebius at FreeBSD.org
Tue Jan 12 22:47:18 UTC 2016
Author: glebius
Date: Tue Jan 12 22:47:16 2016
New Revision: 293785
URL: https://svnweb.freebsd.org/changeset/base/293785
Log:
Switch to perl regexps in applypatches(). We need to match +++ lines from
diffs generated by different sources. At the security officer repo, there
is already a script that has a good regexp to match that by des at . Take the
regexp from there and adjust it a little bit.
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 22:44:23 2016 (r293784)
+++ user/cperciva/freebsd-update-build/scripts/build.subr Tue Jan 12 22:47:16 2016 (r293785)
@@ -401,8 +401,8 @@ applypatches () {
while read PATCH; do
patch -p0 < ${PATCHDIR}/${PATCH}
# Remove ".orig" files created by patch(1) and empty files
- for file in $(sed -Ene \
- 's/^--- (.*)(\.orig$|[[:space:]]*)?/\1/p' < \
+ for file in $(perl -ne \
+ 'print("$1\n") if /^\+\+\+ (?:b\/|\.\/)?(\S+)(?:\s+[(0-9].*)?$/' < \
${PATCHDIR}/${PATCH}); do
echo ${file}.orig
if [ ! -s ${file} ]; then
More information about the svn-src-user
mailing list