]> Cypherpunks.ru repositories - prepro.git/commitdiff
mk-htmls
authorSergey Matveev <stargrave@stargrave.org>
Mon, 14 Aug 2023 17:56:55 +0000 (20:56 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 14 Aug 2023 17:56:55 +0000 (20:56 +0300)
USAGE
list-vers [new file with mode: 0755]
mk-htmls [new file with mode: 0755]
mk-mods

diff --git a/USAGE b/USAGE
index 4ff49c1c18526cd00cbe44451c5b688bd4f5961a7b1a9d0daf1116241960b03a..e3cd6ab32e0414e39d2ee3899dda40bbbd9f08df35f2a5ab25dd3bd987764c6c 100644 (file)
--- a/USAGE
+++ b/USAGE
@@ -10,6 +10,8 @@ and creates corresponding "list" files.
 
 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
 
 For example:
     mkdir proxy
@@ -21,5 +23,5 @@ For example:
 
     mkdir html
     cd html
-    mk-html "http://www.git.cypherpunks.ru/?p=balloon.git" go.cypherpunks.ru/balloon
-    mk-html "http://www.git.cypherpunks.ru/?p=balloon.git" go.cypherpunks.ru/balloon/v2
+    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
diff --git a/list-vers b/list-vers
new file mode 100755 (executable)
index 0000000..e9a5358
--- /dev/null
+++ b/list-vers
@@ -0,0 +1,14 @@
+#!/usr/bin/env zsh
+
+set -e
+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
+    print $modname $version
+done
diff --git a/mk-htmls b/mk-htmls
new file mode 100755 (executable)
index 0000000..93a3866
--- /dev/null
+++ b/mk-htmls
@@ -0,0 +1,11 @@
+#!/usr/bin/env zsh
+
+set -e
+root=$0:h:a
+vcsurl=$1
+vcspath=$2
+modbase=$3
+
+$root/list-vers $vcspath $modbase | while IFS=" " read modname version ; do
+    $root/mk-html $vcsurl $modname
+done
diff --git a/mk-mods b/mk-mods
index ccee342d0e4ee86eda25509ef51553fda6d6e439a6a6ba95d8949a0a98b8bdaf..dbc2bbabafb83b29c7efacc08e8bf91fc9bd0ae08d294b1fafd734058a57aba8 100755 (executable)
--- a/mk-mods
+++ b/mk-mods
@@ -1,18 +1,11 @@
 #!/usr/bin/env zsh
 
 set -e
-
-mkmod=$0:h:a/mk-mod
-
+root=$0:h:a
 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
+$root/list-vers $vcspath $modbase | while IFS=" " read modname version ; do
+    $root/mk-mod $vcsurl $vcspath $modname $version
 done