summaryrefslogtreecommitdiff
path: root/fetch
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-10-28 12:12:28 +0000
committerLars Wirzenius <liw@liw.fi>2012-10-28 12:12:28 +0000
commit5c34b3ba7993b7c7747a5b49d1009be8d50bc4ac (patch)
treeffdab344c13d58158df8aed25dcc69b551bcda29 /fetch
parent4d1e53f92a9b80824b903e46a0744a01a3179872 (diff)
downloadjenkinstool-5c34b3ba7993b7c7747a5b49d1009be8d50bc4ac.tar.gz
Add script to fetch Debian artifacts
Diffstat (limited to 'fetch')
-rwxr-xr-xfetch35
1 files changed, 35 insertions, 0 deletions
diff --git a/fetch b/fetch
new file mode 100755
index 0000000..db8698d
--- /dev/null
+++ b/fetch
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -eu
+
+package="$1"
+version="$2"
+
+repourl="http://192.168.122.113/jenkins/debian"
+
+case "$package" in
+ lib?*)
+ subdir=$(echo "$package" | cut -c1-4)
+ ;;
+ *)
+ subdir=$(echo "$package" | cut -c1)
+ ;;
+esac
+
+baseurl="$repourl/pool/main/$subdir/$package/${package}_$version"
+
+for url in \
+ "${baseurl}_source.changes" \
+ "${baseurl}_all.changes" \
+ "${baseurl}_i386.changes" \
+ "${baseurl}_amd64.changes" \
+ "${baseurl}.squeeze_source.changes" \
+ "${baseurl}.squeeze_all.changes" \
+ "${baseurl}.squeeze_i386.changes" \
+ "${baseurl}.squeeze_amd64.changes"
+do
+ if curl -s --head --fail "$url" | head -n1 | grep -q '^HTTP/1.1 200'
+ then
+ dget -q -d -u "$url"
+ fi
+done