Add "bump-xul" target for staff client Makefile user/tsbere/xulrunner_15
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 30 Aug 2012 13:03:00 +0000 (09:03 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Thu, 30 Aug 2012 13:03:00 +0000 (09:03 -0400)
It looks for the latest non-beta non-release xulrunner version and updates
version numbers across:

Makefile.am (and updates Makefile.in and Makefile while at it)
application.ini
install.rdf

Intent is to be much easier than editing the files by hand.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/Makefile.am

index de789fd..55defed 100644 (file)
@@ -15,7 +15,8 @@ XULRUNNER_VERSION=15.0
 XULRUNNER_WINFILE=xulrunner-$(XULRUNNER_VERSION).en-US.win32.zip
 XULRUNNER_LINUX32FILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-i686.tar.bz2
 XULRUNNER_LINUX64FILE=xulrunner-$(XULRUNNER_VERSION).en-US.linux-x86_64.tar.bz2
-XULRUNNER_URL=ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$(XULRUNNER_VERSION)/runtimes/
+XULRUNNER_BASE_URL=ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/
+XULRUNNER_URL=${XULRUNNER_BASE_URL}$(XULRUNNER_VERSION)/runtimes/
 XULRUNNER_MAJOR_VERSION=$$(echo ${XULRUNNER_VERSION} | cut -d. -f1)
 
 # Extensions we include when not an extension ourselves
@@ -386,3 +387,17 @@ updates updates-client win-updates win-updates-client linux32-updates linux32-up
        @if [ ! -x external/make_updates.sh ]; then chmod u+x external/make_updates.sh; fi
        @if [ ! -x external/make_updates.sh ]; then echo 'ERROR! external/make_updates.sh is not executable!'; exit 1; fi
        @external/make_updates.sh ${UPDATESDIR} $@
+
+# Bumping xul version numbers
+bump-xul:
+       @wget --default-page=.xulrunner_list.html ${XULRUNNER_BASE_URL}
+       @grep -o '<a href="[^"]*">[^<]*/</a>' .xulrunner_list.html | sed 's/^<a.*>\(.*\)\/<\/a>/\1/' | grep -iv '[a-z]' | sort -rV > .xulrunner_list.versions
+       @head -n 1 .xulrunner_list.versions > .xulrunner_list.latest
+       @cat .xulrunner_list.latest | sed 's/^\([0-9]*\)\..*/\1.*/' > .xulrunner_list.wildcarded
+       @sed -i "s/^MaxVersion=.*/MaxVersion=`cat .xulrunner_list.wildcarded`/" application.ini 
+       @sed -i "s|<em:maxVersion>.*</em:maxVersion>|<em:maxVersion>`cat .xulrunner_list.wildcarded`</em:maxVersion>|" install.rdf
+       @sed -i "s/^\(XULRUNNER_VERSION \?= \?\)[0-9].*/\1`cat .xulrunner_list.latest`/" Makefile Makefile.*
+       @rm .xulrunner_list.html
+       @rm .xulrunner_list.versions
+       @rm .xulrunner_list.latest
+       @rm .xulrunner_list.wildcarded