mk-mod utility creates GOPROXY-compatible version of the module in the
current directory:
- mk-mod VCS-URL VCS-PATH MODULE-NAME VERSION.
+ mk-mod VCS-URL VCS-PATH MODULE-NAME VERSION
Only Git VCS is supported. Git tag's name must be equal to VERSION.
+mk-mods iterates through all tags:
+ mk-mods VCS-URL VCS-PATH MODULE-BASE-NAME
mk-list utility collects all known versions in current GOPROXY directory
and creates corresponding "list" files.
mk-goget creates go-import-compatible static files:
- mk-goget VCS-WEB-URL MODULE-NAME.
+ mk-goget VCS-WEB-URL MODULE-NAME
For example:
mkdir proxy
cd proxy
- mk-mod https://git.cypherpunks.ru/balloon.git ~w/balloon go.cypherpunks.ru/balloon v1.1.1
- mk-mod https://git.cypherpunks.ru/balloon.git ~w/balloon go.cypherpunks.ru/balloon/v2 v2.0.0
+ mk-mods https://git.cypherpunks.ru/balloon.git ~w/balloon go.cypherpunks.ru/balloon
+ mk-mods https://git.cypherpunks.ru/gotai64n.git ~w/gotai64n go.cypherpunks.ru/balloon/tai64n
mk-list
cd ..
--- /dev/null
+#!/usr/bin/env zsh
+
+set -e
+
+mkmod=$0:h:a/mk-mod
+
+vcsurl=$1
+vcspath=$2
+modbase=$3
+
+( cd $vcspath ; git tag ) | while read version ; do
+ [[ $version =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]] || continue
+ cols=(${(s:.:)version})
+ v=${cols[1]}
+ modname=$modbase
+ [[ $v == v0 || $v == v1 ]] || modname=${modname}/$v
+ $mkmod $vcsurl $vcspath $modname $version
+done