r67743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67742‎ | r67743 | r67744 >
Date:18:49, 9 June 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Reverted r67722, r67720, r67716, r67715 - (auto version bumping). This is a great idea, but it's broken on OSX (might want to look at using the -e option with sed along with -i, different platforms have different sed implementations) and scripts like Vector/Modules/CollapsibleNav/CollapsibleNav.js aren't being detected as changed.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Makefile (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Makefile
@@ -1,7 +1,6 @@
22 #
33 # Handy makefile to combine and minify css and javascript files
44 #
5 -SHELL := /bin/bash
65
76 CSS := \
87 css/suggestions.css\
@@ -58,31 +57,15 @@
5958 Vector/Modules/FooterCleanup/FooterCleanup.js\
6059 Vector/Modules/SimpleSearch/SimpleSearch.js
6160
62 -USABILITYINITIATIVE_HOOKS := \
 61+all: \
6362 css/combined.css\
6463 css/combined.min.css\
65 - $(CSS)\
6664 js/plugins.combined.js\
6765 js/plugins.combined.min.js\
68 - $(PLUGINS)
69 -
70 -WIKIEDITOR_HOOKS := \
71 - $(WIKIEDITOR_MODULES)\
7266 WikiEditor/WikiEditor.combined.js\
73 - WikiEditor/WikiEditor.combined.min.js
74 -
75 -VECTOR_HOOKS := \
76 - $(VECTOR_MODULES)\
 67+ WikiEditor/WikiEditor.combined.min.js\
7768 Vector/Vector.combined.js\
7869 Vector/Vector.combined.min.js
79 -
80 -all: \
81 - $(USABILITYINITIATIVE_HOOKS)\
82 - $(WIKIEDITOR_HOOKS)\
83 - UsabilityInitiative.hooks.php\
84 - WikiEditor/WikiEditor.hooks.php\
85 - Vector/Vector.hooks.php\
86 -
8770
8871 # JavaScript Combination
8972
@@ -125,16 +108,6 @@
126109 jsmin:
127110 type -P jsmin &>/dev/null || ( wget http://www.crockford.com/javascript/jsmin.c; gcc jsmin.c -o jsmin )
128111
129 -# Simple incrementer of versions
130 -
131 -UsabilityInitiative.hooks.php: $(USABILITYINITIATIVE_HOOKS)
132 -WikiEditor/WikiEditor.hooks.php: $(WIKIEDITOR_HOOKS)
133 -Vector/Vector.hooks.php: $(VECTOR_HOOKS)
134 -
135 -%.hooks.php: $(WIKIEDITOR_HOOKS)
136 - for file in $?; do basefile="$${file#$(shell echo $* | sed "s/\([^\/]*\/\).*/\\1/")}"; sed -i "s/\(.*'src' => '$${basefile//\//\\/}', 'version' => \)\([0-9+]*\)\(.*\)/\\1\\2+1\\3/" $@; \
137 - for i in $$(grep --only-matching -P " ([0-9]+(\+[0-9]))+ " $@); do sed -i "s/ $$i / $$(bc <<< $$i) /" $@; done; done
138 -
139112 # Actions
140113
141114 distclean: clean

Follow-up revisions

RevisionCommit summaryAuthorDate
r677461.16wmf4: Update UsabilityInitiative to r67741 and merge r67743catrope19:16, 9 June 2010
r67763Follow up r67743....platonides21:59, 9 June 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67715Add a basic version incrementer....platonides13:13, 9 June 2010
r67716Follow up r67715. Make that just one metarule.platonides13:19, 9 June 2010
r67720Force usage of bash, since dash doesn't like the substitutions.platonides14:13, 9 June 2010
r67722Remove extra spaces and perform a second pass actually doing the sum....platonides14:44, 9 June 2010

Comments

#Comment by Platonides (talk | contribs)   21:55, 9 June 2010

> This is a great idea, but it's broken on OSX (might want to look at using the -e option with sed along with -i, different platforms have different sed implementations)

Since "is broken" here means "you will need to do this by hand" (as was done before), it's probably better an implementation which doesn't work on all platforms than no implementation at all. At least there's hope for Mac OS. Windows users are probably in most disadvantage.

From [1] the -i option needs a space in Mac OS, while GNU sed doesn't.

> and scripts like Vector/Modules/CollapsibleNav/CollapsibleNav.js aren't being detected as changed. It works here.

I will commit a new version using -e. Please check if it works there (alternatively, send me a Mac :)

If it still doesn't work, try using with gnu make (probably installed as gmake)

Status & tagging log