Bug 790381 - Filter out makefile comments in opus update.sh. r=derf
authorRalph Giles <giles@mozilla.com>
Wed, 12 Sep 2012 16:59:04 -0400
changeset 106926 b1043cd9de878f980528077cf67de371cd51357e
parent 106925 e265b3a3e7432e0abaaf9af84625ec6bba23d7bf
child 106927 fd83eb48a43751072b7cf2cef796926c73a3d594
push id14761
push userryanvm@gmail.com
push dateWed, 12 Sep 2012 20:59:12 +0000
treeherdermozilla-inbound@f00973c233e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersderf
bugs790381
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 790381 - Filter out makefile comments in opus update.sh. r=derf We read *_sources.mk from the opus source tree to get a list of needed files. As of the 1.0.0 release, those files have comment lines, which the previous sed one-liner failed to strip out. The earlier version attempted this with 's/^#.8//', but the whole file has been read into memory so we can remove the line continuation escapes. However, the newlines are still present, so we can replace this with 's/#[^\n]*\(\n\)/\1\g' Which replaces everything from a comment character to a newline with a newline. We have to capture and subsitute the final newline instead of using a literal \n because portable sed doesn't expand that character on the right-hand side. GNU sed will, however.
media/libopus/update.sh
--- a/media/libopus/update.sh
+++ b/media/libopus/update.sh
@@ -19,17 +19,17 @@ MK_FILES="opus_sources.mk celt_sources.m
 if test -z $1 || ! test -r $1/include/opus.h; then
   echo "Update the current directory from a source checkout"
   echo "usage: $0 ../opus"
   exit 1
 fi
 
 # "parse" the makefile fragments to get the list of source files
 # requires GNU sed extensions
-SRC_FILES=$(sed -e ':a;N;$!ba;s/\\\n//g;s/[A-Z_]* = //g' \
+SRC_FILES=$(sed -e ':a;N;$!ba;s/#[^\n]*\(\n\)/\1/g;s/\\\n//g;s/[A-Z_]* = //g' \
              $(for file in ${MK_FILES}; do echo "$1/${file}"; done))
 
 # pre-release versions of the code don't list opus_custom.h
 # in celt_headers.mk, so we must include it manually
 HDR_FILES="include/opus_custom.h"
 
 # make sure the necessary subdirectories exist
 for file in ${SRC_FILES}; do