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

Side by Side Diff: inst/download_devbuilds_list.sh

Issue 29336289: devbuild
Patch Set: Created Feb. 12, 2016, 1:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2 # downloads the current list of published adblockplus devbuilds
3 # output csv: datetime, version, addonName
4 PRODUCTS="adblockpluschrome adblockplus adblockplusie adblockplusopera adblockpl ussafari adblockplusandroid"
5 # adblockbrowser
6 TMPDIR_DEV=$(mktemp -d)/
7
8 wget -q -O ${TMPDIR_DEV}website_adblockpluschrome https://downloads.adblockplus. org/devbuilds/adblockpluschrome
9 wget -q -O ${TMPDIR_DEV}website_adblockplusopera https://downloads.adblockplus.o rg/devbuilds/adblockplusopera
10 wget -q -O ${TMPDIR_DEV}website_adblockplussafari https://downloads.adblockplus. org/devbuilds/adblockplussafari
11 wget -q -O ${TMPDIR_DEV}website_adblockplusandroid https://downloads.adblockplus .org/devbuilds/adblockplusandroid
12 wget -q -O ${TMPDIR_DEV}website_adblockplus https://addons.mozilla.org/en-US/fir efox/addon/adblock-plus/versions/beta
13 wget -q -O ${TMPDIR_DEV}website_adblockplusie https://downloads.adblockplus.org/ devbuilds/adblockplusie
14 #wget -q -O ${TMPDIR_DEV}website_adblockbrowser https://downloads.adblockplus.or g/devbuilds/adblockbrowser
15
16 # prepare exact versions as sent by the extension for joining tables
17 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_adblock pluschrome
18 grep -o 'Adblock Plus for Opera [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}web site_adblockplusopera | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplusopera
19 grep -o 'Adblock Plus for Safari [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}we bsite_adblockplussafari | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplussaf ari
20 grep -o 'Adblock Plus for Android [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_DEV}w ebsite_adblockplusandroid | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockplusa ndroid
21 grep -o 'Version [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*-beta' ${TMPDIR_DEV}website_adblo ckplus | cut -d " " -f 2 > ${TMPDIR_DEV}versions_adblockplus
22 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
23 #grep -o 'Adblock Browser for Android [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' ${TMPDIR_D EV}website_adblockbrowser | cut -d " " -f 5 > ${TMPDIR_DEV}versions_adblockbrows er
24
25 # we want to assess the relevance of the devbuilds: most recent devbuilds need t o be monitored closely
26 grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockpluschr ome > ${TMPDIR_DEV}dates_adblockpluschrome
27 grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusope ra > ${TMPDIR_DEV}dates_adblockplusopera
28 grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplussaf ari > ${TMPDIR_DEV}dates_adblockplussafari
29 grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusand roid > ${TMPDIR_DEV}dates_adblockplusandroid
30 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
31 grep -o '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*' ${TMPDIR_DEV}website_adblockplusie > ${TMPDIR_DEV}dates_adblockplusie
32 #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
33
34 # csv is easily readable by many tools, want one stream for all devbuilds
35 # e.g. piping into file or loading stdout within another program
36 for product in $PRODUCTS; do
37 lendates=$(cat ${TMPDIR_DEV}dates_$product | wc -l)
38 lenversions=$(cat ${TMPDIR_DEV}versions_$product | wc -l)
39 if [ "${lenversions}" != "${lendates}" ]; then
40 echo "ERROR: $product files have different lengths."
41 exit 1
42 fi
43 yes ${product} | head -n ${lendates} | paste -d "," ${TMPDIR_DEV}dates_$ product ${TMPDIR_DEV}versions_$product - > ${TMPDIR_DEV}published_$product.csv
44 done
45
46 for product in $PRODUCTS; do
47 cat ${TMPDIR_DEV}published_$product.csv
48 done
49
50 # don't leave clutter
51 rm -rf ${TMPDIR_DEV}
OLDNEW
« 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