]> Cypherpunks.ru repositories - gocheese.git/commitdiff
Version refactoring v2.4.1
authorSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 08:42:03 +0000 (11:42 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 5 Sep 2020 08:47:04 +0000 (11:47 +0300)
.gitignore
VERSION [deleted file]
VERSION.do [new file with mode: 0644]
clean.do [new file with mode: 0644]
contrib/pyshop2packages.sh [moved from pyshop2packages.sh with 100% similarity]
gocheese.do
gocheese.go
gocheese.info.do
install.texi
makedist.sh
www.do

index 10f838dbd0804d894279446bb267648f7951038c..fa62ba15a65d3ea1fdf5282a739e2f8a762f3c98 100644 (file)
@@ -2,3 +2,4 @@ gocheese
 gocheese.info
 gocheese.html
 module-name
+VERSION
diff --git a/VERSION b/VERSION
deleted file mode 100644 (file)
index 197c4d5..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.4.0
diff --git a/VERSION.do b/VERSION.do
new file mode 100644 (file)
index 0000000..afefe20
--- /dev/null
@@ -0,0 +1,2 @@
+redo-ifchange gocheese.go
+perl -ne 'print "$1\n" if /Version.*"(.*)"$/' < gocheese.go
diff --git a/clean.do b/clean.do
new file mode 100644 (file)
index 0000000..4201b5f
--- /dev/null
+++ b/clean.do
@@ -0,0 +1 @@
+rm -f gocheese module-name VERSION
index 3a7df901a1640bfb508149fe5887eb579ecd44dd..a5f7cc5cf5244a30b01a30fe18fa51d21e43d6d2 100644 (file)
@@ -1,2 +1,2 @@
 redo-ifchange *.go module-name
-${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" `cat module-name`
+${GO:=go} build -o $3 `cat module-name`
index 70573b8f0085451ca716cb0b62e594697bb95481..fa12d1826df911354147c04affae276fbcf19244 100644 (file)
@@ -43,6 +43,7 @@ import (
 )
 
 const (
+       Version   = "2.4.1"
        HTMLBegin = `<!DOCTYPE html>
 <html>
   <head>
@@ -98,7 +99,6 @@ var (
        version          = flag.Bool("version", false, "Print version information")
        warranty         = flag.Bool("warranty", false, "Print warranty information")
 
-       Version       string = "UNKNOWN"
        killed        bool
        pypiURLParsed *url.URL
 )
index f9fef359b8eb5d6f09f8138ad996e7eed127d0e1..7cbe4cac010030f8c89d19a3a49eddbb3a3ed1de 100644 (file)
@@ -1,2 +1,6 @@
-redo-ifchange *.texi
-${MAKEINFO:=makeinfo} -o $3 gocheese.texi
+redo-ifchange *.texi VERSION
+${MAKEINFO:-makeinfo} \
+    -D "VERSION `cat VERSION`" \
+    --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
+    --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
+    --output $3 gocheese.texi
index 3c46c5aceb0a99146db2caa2264573b11c214cd5..2b605eeec5bae14ffd6aba126f636395635a5dce 100644 (file)
@@ -1,8 +1,6 @@
 @node Install
 @unnumbered Install
 
-@set VERSION 2.4.0
-
 Preferable way is to download tarball with the signature from
 website and, for example, run tests with benchmarks:
 
@@ -12,17 +10,14 @@ $ [fetch|wget] http://www.gocheese.cypherpunks.ru/gocheese-@value{VERSION}.tar.x
 $ gpg --verify gocheese-@value{VERSION}.tar.xz.sig gocheese-@value{VERSION}.tar.xz
 $ xz -d < gocheese-@value{VERSION}.tar.xz | tar xf -
 $ cd gocheese-@value{VERSION}
-$ redo all test
+$ redo test all
 @end example
 
 It uses @url{http://cr.yp.to/redo.html, redo} build system for that
 examples. You can use either dozen of various implementations, or at
-least minimalistic POSIX shell @code{apenwarr/do}:
-
-@example
-$ [fetch|wget] https://github.com/apenwarr/redo/raw/master/minimal/do
-$ mv do redo ; chmod +x redo
-@end example
+least minimalistic POSIX shell @command{contrib/do} (just replace
+@command{redo} with @command{contrib/do} in the example above) included
+in tarball.
 
 @include download.texi
 
index b9e3d271f464a4a6fccd1a4216f8f9734f973045..87e7b6f988d32dd022347249bae203f51126de69 100755 (executable)
@@ -4,14 +4,20 @@ cur=$(pwd)
 tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
-MAKEINFO=${MAKEINFO:=makeinfo}
 
 git clone . $tmp/gocheese-$release
 cd $tmp/gocheese-$release
 git checkout v$release
 
-redo-ifchange module-name
+redo-ifchange module-name VERSION
 mod_name=`cat module-name`
+
+cat > download.texi <<EOF
+You can obtain releases source code prepared tarballs on
+@url{http://www.gocheese.cypherpunks.ru/}.
+EOF
+redo gocheese.info
+
 crypto_mod_path=$(sed -n 's#^require \(golang.org/x/crypto\) \(.*\)$#\1@\2#p' go.mod)
 mkdir -p src/$mod_name
 mv *.go go.mod go.sum src/$mod_name
@@ -66,11 +72,12 @@ tar cfCI - src $tmp/includes | tar xfC - $tmp
 rm -fr src/golang.org $tmp/includes
 mv $tmp/golang.org src
 
-cat > download.texi <<EOF
-You can obtain releases source code prepared tarballs on
-@url{http://www.gocheese.cypherpunks.ru/}.
-EOF
-redo gocheese.info
+mkinfo() {
+    ${MAKEINFO:=makeinfo} --plaintext \
+        --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
+        --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
+        -D "VERSION `cat VERSION`" $@
+}
 
 texi=$(mktemp)
 cat > $texi <<EOF
@@ -81,16 +88,17 @@ cat > $texi <<EOF
 @bye
 EOF
 perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
-$MAKEINFO --plaintext -o INSTALL $texi
+mkinfo --output INSTALL $texi
 rm $texi
 
-rm -rf .redo .git .gitignore style.css makedist.sh www.do module-name.do
-echo 'GOPATH=`pwd` ${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" `cat module-name`' > gocheese.do
+rm -rf .redo .git .gitignore style.css makedist.sh www.do module-name.do VERSION.do
+echo 'GOPATH=`pwd` ${GO:=go} build -o $3 `cat module-name`' > gocheese.do
 echo 'GOPATH=`pwd` ${GO:=go} test `cat module-name`/... >&2' > test.do
+cp ~/work/redo/minimal/do contrib/do
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
-chmod +x pyshop2packages.sh
+chmod 755 contrib/pyshop2packages.sh contrib/do
 
 cd ..
 tar cvf gocheese-"$release".tar --uid=0 --gid=0 --numeric-owner gocheese-"$release"
diff --git a/www.do b/www.do
index 61a9a9618a63a24413389859277cddf92cb1d0a2..778c3d46656b1cb084679fd6c5c2e0049004a7e8 100644 (file)
--- a/www.do
+++ b/www.do
@@ -1,12 +1,14 @@
-rm -f gocheese.html/*.html
+redo-ifchange *.texi VERSION
+html=gocheese.html
+rm -f $html/*.html
 ${MAKEINFO:=makeinfo} --html \
+    -D "VERSION `cat VERSION`" \
     --set-customization-variable CSS_LINES="`cat style.css`" \
     --set-customization-variable SHOW_TITLE=0 \
-    --set-customization-variable USE_ACCESSKEY=0 \
     --set-customization-variable DATE_IN_HEADER=1 \
     --set-customization-variable TOP_NODE_UP_URL=index.html \
     --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \
     --set-customization-variable OPEN_QUOTE_SYMBOL=\" \
-    -o gocheese.html gocheese.texi
-find gocheese.html -type d -exec chmod 755 {} \;
-find gocheese.html -type f -exec chmod 644 {} \;
+    -o $html gocheese.texi
+find $html -type d -exec chmod 755 {} \;
+find $html -type f -exec chmod 644 {} \;