]> WPIA git - gigi.git/commitdiff
chg: refactor script to fetch external libraries
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Wed, 17 Jan 2018 23:23:55 +0000 (00:23 +0100)
committerFelix Dörre <felix@dogcraft.de>
Thu, 18 Jan 2018 19:51:18 +0000 (20:51 +0100)
With this formulation of the script, we only need to change one place in
the script to update or add libraries. (However, the separate .gitignore
and checksums.txt files still need to be updated as well.)

(The unquoted $(basename ...) is safe because we know the basenames
cannot contain spaces – at worst, they would be URL-encoded as %20.)

Change-Id: I47ec8fcb1e1c581df52a9e31f726bcc35fe8f94b

lib/external/fetch.sh

index 1a094d9c22533ef537662fde3b6dc52cb190ed04..c733449bb77df9948a3fd62074cdfa930d386e22 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/bash
-wget -N "http://www.dnsjava.org/download/dnsjava-2.1.8.zip" "http://www.dnsjava.org/download/dnsjava-2.1.8.jar"
+externals=(
+    'http://www.dnsjava.org/download/dnsjava-2.1.8.zip'
+    'http://www.dnsjava.org/download/dnsjava-2.1.8.jar'
+)
+wget -N "${externals[@]}"
 if ! sha256sum -c checksums.txt; then
-    rm -vf dnsjava-2.1.8.zip dnsjava-2.1.8.jar
+    rm -vf $(basename -a "${externals[@]}")
 fi