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 [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
+ mk-mods VCS-URL VCS-PATH MODULE-BASE-NAME [SIGNKEY]
+SIGNKEY is optional path to OpenSSH signing key, that will sign the
+.ziphash file.
mk-list utility collects all known versions in current GOPROXY directory
and creates corresponding "list" files.
vcspath=$2
modname=$3
version=$4
+signkey=$5
dst=$modname/@v
mkdir -p $dst
unzip -p $version.zip ${modname}@${version}/go.mod > $version.mod
printf '{"Version":"%s","Time":"%s","Origin":{"VCS":"git","URL":"%s","Ref":"refs/tags/%s","Hash":"%s"}}' \
$version $when $vcsurl $version $hsh > $version.info
-touch -d $when $version.info $version.mod $version.zip $version.ziphash
+totouch=($version.info $version.mod $version.zip $version.ziphash)
+[[ -z $signkey ]] || {
+ ssh-keygen -Y sign -f $signkey -n file $version.ziphash
+ totouch=($totouch $version.ziphash.sig)
+}
+touch -d $when $totouch
vcsurl=$1
vcspath=$2
modbase=$3
+signkey=$4
$root/list-vers $vcspath $modbase | while IFS=" " read modname version ; do
- $root/mk-mod $vcsurl $vcspath $modname $version
+ $root/mk-mod $vcsurl $vcspath $modname $version $signkey
done