r68036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68035‎ | r68036 | r68037 >
Date:22:24, 14 June 2010
Author:platonides
Status:ok
Tags:
Comment:
Fix bug introduced in r68034 where only the minified file get bumped.

Following talk with River, replace GNU grep with sed. This changes a bit
the regex semantic to acommodate for seds like Solaris, which don't support
extended RE (POSIX only states it has to accept basic RE)
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Makefile (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Makefile
@@ -152,8 +152,8 @@
153153 # For each group of summing numbers inside the target file, use shell arithmetic expansion to calculate the sum.
154154 # Replace all numbers at once with sed. The replacements are preceded have a leading ; an empty expression about which sed doesn't care.
155155 %.hooks.php: $(WIKIEDITOR_HOOKS)
156 - for file in $?; do basefile="$${file#$(shell echo $* | sed "s/\([^\/]*\/\).*/\\1/")}"; sed -e "s/\(.*'src' => '$${basefile//\//\\/}', 'version' => \)\([0-9+]*\)\(.*\)/\\1\\2+1\\3/" $@ > $@.counter; done; \
157 - RE=""; for i in $$(grep --only-matching -P " ([0-9]+(\+[0-9])+) " $@.counter); do RE="$$RE;s/ $$i / $$(($$i)) /"; done; sed -e "$$RE" $@.counter > $@ && rm $@.counter
 156+ for file in $?; do basefile="$${file#$(shell echo $* | sed "s/\([^\/]*\/\).*/\\1/")}"; sed -e "s/\(.*'src' => '$${basefile//\//\\/}', 'version' => \)\([0-9+]*\)\(.*\)/\\1\\2+1\\3/" $@ > $@.counter && cat $@.counter > $@; done; \
 157+ RE=""; for i in $$(sed -n 's/.* \([0-9][0-9]*+[0-9+]*\) .*/\1/p' $@.counter); do RE="$$RE;s/ $$i / $$(($$i)) /"; done; sed -e "$$RE" $@.counter > $@ && rm $@.counter
158158
159159 # Actions
160160

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68034Fix grep regex, move out the inner loop, aggregate all second-stage sed calls...platonides21:39, 14 June 2010

Status & tagging log