set -e
if (( ${#} < 1 )); then
- echo "usage: ${0} VERSION FILE..."
+ 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
rm -f "${FILE}".directive
cat > "${FILE}".directive <<EOF
version: 1.2
-directory: mit-scheme/stable.pkg/${VERSION}
+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