From f895a1ab01c966aeeafe2c743120fdbc81618efa Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Thu, 18 Jan 2018 00:23:55 +0100 Subject: [PATCH] chg: refactor script to fetch external libraries MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/external/fetch.sh b/lib/external/fetch.sh index 1a094d9c..c733449b 100755 --- a/lib/external/fetch.sh +++ b/lib/external/fetch.sh @@ -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 -- 2.39.2