Script to generate upload files for GNU FTP server.
authorChris Hanson <org/chris-hanson/cph>
Sat, 15 Oct 2011 10:10:11 +0000 (03:10 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sat, 15 Oct 2011 10:10:11 +0000 (03:10 -0700)
dist/make-upload-files [new file with mode: 0755]

diff --git a/dist/make-upload-files b/dist/make-upload-files
new file mode 100755 (executable)
index 0000000..f57ab5e
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+
+if (( ${#} < 1 )); then
+    echo "usage: ${0} VERSION FILE..."
+    exit 1
+fi
+
+VERSION=${1}
+shift
+
+if ! [[ ${VERSION} =~ ^[0-9.]+$ ]]; then
+    echo "${VERSION} doesn't look like a version number"
+    echo "usage: ${0} VERSION FILE..."
+    exit 1
+fi
+
+for FILE in "${@}"; do
+    rm -f "${FILE}".directive
+    cat > "${FILE}".directive <<EOF
+version: 1.1
+directory: mit-scheme/stable.pkg/${VERSION}
+filename: ${FILE}
+EOF
+    rm -f "${FILE}".sig "${FILE}".directive.asc
+    gpg -b "${FILE}"
+    gpg --clearsign "${FILE}".directive && rm "${FILE}".directive
+done