From 9fdef0e25b1d4d813625e3796221469ef4a4a463 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 7 Apr 2014 15:15:06 -0700 Subject: update-oojs.sh: Rewrite to fetch from npm repo instead of building from git * Fetch upstream build from npm repository instead of building it locally from git (to avoid different timestamps and checksums not matching, no need for MediaWiki code to know how to build a oojs distribution). * Ran it which changed the oojs.js file slightly (it now contains the file as released on npmjs.org instead of the local build by the person who last updated it in mediawiki). Follows-up: * 648667a - Split up resources/ into resources/lib/ and resources/src/ * c68b967 - Add scripts to generate update builds of OOjs Change-Id: I63f79293e21781c1db3d7c43658c22f58ba9102d --- resources/lib/oojs/oojs.js | 2 +- resources/lib/oojs/update-oojs.sh | 99 --------------------------------------- 2 files changed, 1 insertion(+), 100 deletions(-) delete mode 100755 resources/lib/oojs/update-oojs.sh (limited to 'resources/lib/oojs') diff --git a/resources/lib/oojs/oojs.js b/resources/lib/oojs/oojs.js index f9538784dc91..8ca3aed909ca 100644 --- a/resources/lib/oojs/oojs.js +++ b/resources/lib/oojs/oojs.js @@ -6,7 +6,7 @@ * Released under the MIT license * http://oojs.mit-license.org * - * Date: Wed Apr 02 2014 14:29:36 GMT-0700 (PDT) + * Date: Wed Apr 02 2014 14:20:50 GMT-0700 (PDT) */ ( function ( global ) { diff --git a/resources/lib/oojs/update-oojs.sh b/resources/lib/oojs/update-oojs.sh deleted file mode 100755 index 57c762588237..000000000000 --- a/resources/lib/oojs/update-oojs.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash - -# FIXME this script is duplicated from update-oojs-ui.sh - factor this out - -# This script generates a commit that updates the oojs distribution -# ./bin/update-oojs.sh path/to/repo/for/oojs - -function oojshash() { - grep "OOjs v" resources/oojs/oojs.js \ - | head -n 1 \ - | grep -Eo '\([a-z0-9]+\)' \ - | sed 's/^(//' \ - | sed 's/)$//' -} - -function oojstag() { - grep "OOjs v" resources/oojs/oojs.js \ - | head -n 1 \ - | grep -Eo '\bv[0-9a-z.-]+\b' -} - -function oojsversion() { - grep "OOjs v" resources/oojs/oojs.js \ - | head -n 1 \ - | grep -Eo '\bv[0-9a-z.-]+\b.*$' -} - -# cd to the MW directory -cd $(cd $(dirname $0)/../..; pwd) - -if [ "x$1" == "x" ] -then - echo >&2 "Usage: update-oojs.sh path/to/repo/for/oojs" - exit 1 -fi - -# Undo any changes in the oojs directory -git reset resources/oojs/ -git checkout resources/oojs/ - -git fetch origin -# Create a branch of MW if needed, and reset it to master -git checkout -B update-oojs origin/master - -# Get the old oojs version -OLDVERSION=$(oojshash) -if [ "x$OLDVERSION" == "x" ] -then - TAG=$(oojstag) -fi - -# cd to the oojs directory -cd $1 || exit 1 -if [ "x$OLDVERSION" == "x" ] -then - # Try the tag - OLDVERSION=$(git rev-parse $TAG) - if [ $? != 0 ] - then - echo Could not find OOjs version - cd - - exit 1 - fi -fi -if [ "$(git rev-parse $OLDVERSION)" == "$(git rev-parse HEAD)" ] -then - echo "No changes (already at $OLDVERSION)" - cd - - exit 0 -fi -# Build the distribution -npm install || exit 1 -grunt || exit 1 -# Get the list of changes -NEWCHANGES=$(git log $OLDVERSION.. --oneline --no-merges --reverse --color=never) -NEWCHANGESDISPLAY=$(git log $OLDVERSION.. --oneline --no-merges --reverse --color=always) -# cd back to the VisualEditor directory -cd - - -# Copy files from dist/ to resources/oojs/ -cp -a $1/dist/* resources/oojs/ -# Figure out what the new version is -NEWVERSION=$(oojsversion) -# Generate commit summary -COMMITMSG=$(cat <&2 <