5 | | ant clean dist # Do this for r17862 and r17861, copy to a working directory |
6 | | cd ${WORKING_DIRECTORY} |
7 | | # Get the plugin list |
8 | | curl -O https://josm.openstreetmap.de/plugin |
9 | | # Get the plugin download URLs |
10 | | JOBS=(`cat plugin | grep -E "^.*.jar;" | awk -F';' '{print $2}'`) |
11 | | mkdir -p .cache |
12 | | # This just caches the plugins, so that a rerun doesn't get the plugins again |
13 | | for PLUGIN in $JOBS; do |
| 5 | #!/usr/bin/env bash |
| 6 | set -ex |
| 7 | |
| 8 | function get_plugins() { |
| 9 | curl -O https://josm.openstreetmap.de/plugin |
| 10 | # Get the plugin download URLs |
| 11 | JOBS=(`cat plugin | grep -E "^.*.jar;" | awk -F';' '{print $2}'`) |
| 12 | mkdir -p .cache |
| 13 | # This just caches the plugins, so that a rerun doesn't get the plugins again |
| 14 | for PLUGIN in $JOBS; do |
16 | | curl -z .cache/$PLUGIN_NAME --output .cache/$PLUGIN_NAME $PLUGIN |
17 | | done |
18 | | for i in .cache/*; do |
| 17 | curl -Lz .cache/$PLUGIN_NAME --output .cache/$PLUGIN_NAME $PLUGIN |
| 18 | done |
| 19 | } |
| 20 | |
| 21 | function get_josm() { |
| 22 | # Check if already downloaded |
| 23 | if [ -e ".cache/josm-r$1.jar" ]; then |
| 24 | return |
| 25 | fi |
| 26 | if [[ $1 =~ "^[0-9]+$" ]]; then |
| 27 | curl -Lz .cache/josm-r$1.jar --output .cache/josm-r$1.jar https://josm.openstreetmap.de/download/josm-snapshot-$1.jar |
| 28 | if [[ ! -e ".cache/josm-r$1.jar" ]]; then |
| 29 | curl -Lz .cache/josm-r$1.jar --output .cache/josm-r$1.jar https://josm.openstreetmap.de/download/Archiv/josm-snapshot-$1.jar |
| 30 | fi |
| 31 | else |
| 32 | curl -Lz .cache/josm-$1.jar --output .cache/josm-$1.jar https://josm.openstreetmap.de/download/josm-$1.jar |
| 33 | fi |
| 34 | } |
| 35 | |
| 36 | function run_checker() { |
| 37 | get_josm $1 |
| 38 | get_josm $2 |
| 39 | for i in .cache/*; do |
| 40 | while [ $(jobs | wc -l) -gt 4 ]; do |
| 41 | sleep 10s |
| 42 | done |