1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/bash
set -e
if (( ${#} < 1 )); then
echo "usage: ${0} [-r REPO] VERSION FILE..."
exit 1
fi
if [[ ${1} == -r ]]; then
shift
REPO=${1}
shift
case ${REPO} in
stable|testing|snapshot|unstable)
:
;;
*)
echo "Unrecognized REPO: ${REPO}"
exit 1
;;
esac
else
REPO=stable
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
# Ignore files written by this script.
[[ ${FILE} == *.directive ]] && continue
[[ ${FILE} == *.asc ]] && continue
[[ ${FILE} == *.sig ]] && continue
rm -f "${FILE}".directive
cat > "${FILE}".directive <<EOF
version: 1.2
directory: mit-scheme/${REPO}.pkg/${VERSION}
filename: ${FILE}
EOF
rm -f "${FILE}".sig "${FILE}".directive.asc
gpg -b "${FILE}"
gpg --clearsign "${FILE}".directive && rm "${FILE}".directive
chmod -w "${FILE}".sig "${FILE}".directive.asc
done
|