]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Generalize make-upload-files to support other repositories.
authorChris Hanson <org/chris-hanson/cph>
Mon, 22 Jun 2020 00:32:03 +0000 (17:32 -0700)
committerChris Hanson <org/chris-hanson/cph>
Mon, 22 Jun 2020 00:32:03 +0000 (17:32 -0700)
dist/make-upload-files

index 4bd8a09eeacc88b60955dfbc3c84a04ca1fe3eb2..35181cb7134eb9f5935ca8f4ae34131b1bf4c018 100755 (executable)
@@ -2,10 +2,27 @@
 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
 
@@ -24,10 +41,11 @@ for FILE in "${@}"; do
     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