mk-mod VCS-URL VCS-PATH MODULE-NAME VERSION [SIGNKEY]
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 [SIGNKEY]
+ mk-mods VCS-URL VCS-PATH [SIGNKEY]
SIGNKEY is optional path to OpenSSH signing key, that will sign the
.ziphash file.
mk-html creates go-import-compatible static files:
mk-html VCS-WEB-URL MODULE-NAME
mk-htmls iterates through all tags:
- mk-htmls VCS-WEB-URL VCS-PATH MODULE-BASE-NAME
+ mk-htmls VCS-WEB-URL VCS-PATH
For example:
mkdir proxy
cd proxy
- 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-mods https://git.cypherpunks.ru/balloon.git ~w/balloon
+ mk-mods https://git.cypherpunks.ru/gotai64n.git ~w/gotai64n
mk-list
cd ..
mkdir html
cd html
- mk-htmls "http://www.git.cypherpunks.ru/?p=balloon.git" ~w/balloon go.cypherpunks.ru/balloon
- mk-htmls "http://www.git.cypherpunks.ru/?p=gotai64n.git" ~w/gotai64n go.cypherpunks.ru/balloon/tai64n
+ mk-htmls "http://www.git.cypherpunks.ru/?p=balloon.git" ~w/balloon
+ mk-htmls "http://www.git.cypherpunks.ru/?p=gotai64n.git" ~w/gotai64n
setopt ERR_EXIT
vcs=$1
-mod=$2
cd $vcs
git tag | while read version ; do
[[ $version =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]] || continue
cols=(${(s:.:)version})
v=${cols[1]}
- modname=$mod
- [[ $v == v0 || $v == v1 ]] || modname=${modname}/$v
+ modname=$(git archive $version | tar xfO - go.mod | sed -n "s/^module //p")
print $modname $version
done
root=$0:h:a
vcsurl=$1
vcspath=$2
-modbase=$3
-$root/list-vers $vcspath $modbase | while IFS=" " read modname version ; do
+$root/list-vers $vcspath | while IFS=" " read modname version ; do
$root/mk-html $vcsurl $modname
done
--- /dev/null
+#!/usr/bin/env zsh
+
+setopt ERR_EXIT
+
+modname=$1
+version=$2
+signkey=$3
+
+cd $modname/@v
+[[ ! -s $version.ziphash.sig ]] || exit 0
+ssh-keygen -Y sign -f $signkey -n file $version.ziphash
+touch -r $version.ziphash $version.ziphash.sig
root=$0:h:a
vcsurl=$1
vcspath=$2
-modbase=$3
-signkey=$4
+signkey=$3
-$root/list-vers $vcspath $modbase | while IFS=" " read modname version ; do
+$root/list-vers $vcspath | while IFS=" " read modname version ; do
$root/mk-mod $vcsurl $vcspath $modname $version
$root/mk-mod-sig $modname $version $signkey
done