Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: inst/download_devbuilds_list.sh

Issue 29336289: devbuild
Patch Set: Created Feb. 12, 2016, 1:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « inst/download_default_easylist_subscriptions.sh ('k') | inst/filter_devbuilds_conf.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: inst/download_devbuilds_list.sh
diff --git a/inst/download_devbuilds_list.sh b/inst/download_devbuilds_list.sh
new file mode 100755
index 0000000000000000000000000000000000000000..2a4e81977ee3ba44e14c7282027694d829701b91
--- /dev/null
+++ b/inst/download_devbuilds_list.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# downloads the current list of published adblockplus devbuilds
+# output csv: datetime, version, addonName
+PRODUCTS="adblockpluschrome adblockplus adblockplusie adblockplusopera adblockplussafari adblockplusandroid"
+# adblockbrowser
+TMPDIR_DEV=$(mktemp -d)/
+
+wget -q -O ${TMPDIR_DEV}website_adblockpluschrome https://downloads.adblockplus.org/devbuilds/adblockpluschrome
+wget -q -O ${TMPDIR_DEV}website_adblockplusopera https://downloads.adblockplus.org/devbuilds/adblockplusopera
+wget -q -O ${TMPDIR_DEV}website_adblockplussafari https://downloads.adblockplus.org/devbuilds/adblockplussafari
+wget -q -O ${TMPDIR_DEV}website_adblockplusandroid https://downloads.adblockplus.org/devbuilds/adblockplusandroid
+wget -q -O ${TMPDIR_DEV}website_adblockplus https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/versions/beta
+wget -q -O ${TMPDIR_DEV}website_adblockplusie https://downloads.adblockplus.org/devbuilds/adblockplusie
+#wget -q -O ${TMPDIR_DEV}website_adblockbrowser https://downloads.adblockplus.org/devbuilds/adblockbrowser
+
+# prepare exact versions as sent by the extension for joining tables
+grep -o 'Adblock Plus for Google Chrome [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockpluschrome | cut -d " " -f 6 > ${TMPDIR_DEV}versions_adblockpluschrome
+grep -o 'Adblock Plus for Opera [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockplusopera | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplusopera
+grep -o 'Adblock Plus for Safari [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockplussafari | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplussafari
+grep -o 'Adblock Plus for Android [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockplusandroid | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplusandroid
+grep -o 'Version [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*-beta' ${TMPDIR_DEV}website_adblockplus | cut -d " " -f 2 > ${TMPDIR_DEV}versions_adblockplus
+grep -o 'Adblock Plus for Internet Explorer [0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockplusie | cut -d " " -f 6 > ${TMPDIR_DEV}versions_adblockplusie
+#grep -o 'Adblock Browser for Android [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}website_adblockbrowser | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockbrowser
+
+# we want to assess the relevance of the devbuilds: most recent devbuilds need to be monitored closely
+grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockpluschrome > ${TMPDIR_DEV}dates_adblockpluschrome
+grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusopera > ${TMPDIR_DEV}dates_adblockplusopera
+grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplussafari > ${TMPDIR_DEV}dates_adblockplussafari
+grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusandroid > ${TMPDIR_DEV}dates_adblockplusandroid
+grep -o '[0-9]*-[0-9]*-[0-9]*T[0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplus | sed 's/T/ /g' > ${TMPDIR_DEV}dates_adblockplus
+grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusie > ${TMPDIR_DEV}dates_adblockplusie
+#cut -d "." -f 4 ${TMPDIR_DEV}versions_adblockbrowser | awk -F "" '{print $1$2$3$4"-"$5$6"-"$7$8" "$9$10":"$11$12}' > ${TMPDIR_DEV}dates_adblockbrowser
+
+# csv is easily readable by many tools, want one stream for all devbuilds
+# e.g. piping into file or loading stdout within another program
+for product in $PRODUCTS; do
+ lendates=$(cat ${TMPDIR_DEV}dates_$product | wc -l)
+ lenversions=$(cat ${TMPDIR_DEV}versions_$product | wc -l)
+ if [ "${lenversions}" != "${lendates}" ]; then
+ echo "ERROR: $product files have different lengths."
+ exit 1
+ fi
+ yes ${product} | head -n ${lendates} | paste -d "," ${TMPDIR_DEV}dates_$product ${TMPDIR_DEV}versions_$product - > ${TMPDIR_DEV}published_$product.csv
+done
+
+for product in $PRODUCTS; do
+ cat ${TMPDIR_DEV}published_$product.csv
+done
+
+# don't leave clutter
+rm -rf ${TMPDIR_DEV}
« no previous file with comments | « inst/download_default_easylist_subscriptions.sh ('k') | inst/filter_devbuilds_conf.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld