]> Cypherpunks.ru repositories - gocheese.git/commitdiff
Less hardcoded module name v2.4.0
authorSergey Matveev <stargrave@stargrave.org>
Fri, 24 Jul 2020 09:44:48 +0000 (12:44 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 24 Jul 2020 10:06:24 +0000 (13:06 +0300)
.gitignore
gocheese.do
makedist.sh
module-name.do [new file with mode: 0644]
test.do

index 87d55b6ac6fd51f48d6196207ac16aec505df089..10f838dbd0804d894279446bb267648f7951038c 100644 (file)
@@ -1,3 +1,4 @@
 gocheese
 gocheese.info
 gocheese.html
 gocheese
 gocheese.info
 gocheese.html
+module-name
index f7937fd5af14d26ff0e91ea22802ddb15008e344..3a7df901a1640bfb508149fe5887eb579ecd44dd 100644 (file)
@@ -1,2 +1,2 @@
-redo-ifchange *.go
-${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" go.cypherpunks.ru/gocheese/v2
+redo-ifchange *.go module-name
+${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" `cat module-name`
index 8693220447b1aa027296c42f46de52637f877134..b9e3d271f464a4a6fccd1a4216f8f9734f973045 100755 (executable)
@@ -4,12 +4,14 @@ cur=$(pwd)
 tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
 tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
+MAKEINFO=${MAKEINFO:=makeinfo}
 
 git clone . $tmp/gocheese-$release
 cd $tmp/gocheese-$release
 git checkout v$release
 
 
 git clone . $tmp/gocheese-$release
 cd $tmp/gocheese-$release
 git checkout v$release
 
-mod_name=$(sed -n 's/^module //p' go.mod)
+redo-ifchange module-name
+mod_name=`cat module-name`
 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
 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
@@ -68,7 +70,7 @@ cat > download.texi <<EOF
 You can obtain releases source code prepared tarballs on
 @url{http://www.gocheese.cypherpunks.ru/}.
 EOF
 You can obtain releases source code prepared tarballs on
 @url{http://www.gocheese.cypherpunks.ru/}.
 EOF
-make gocheese.info
+redo gocheese.info
 
 texi=$(mktemp)
 cat > $texi <<EOF
 
 texi=$(mktemp)
 cat > $texi <<EOF
@@ -79,10 +81,12 @@ cat > $texi <<EOF
 @bye
 EOF
 perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
 @bye
 EOF
 perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
-makeinfo --plaintext -o INSTALL $texi
+$MAKEINFO --plaintext -o INSTALL $texi
 rm $texi
 
 rm $texi
 
-rm -rf .git .gitignore style.css makedist.sh www.mk
+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
+echo 'GOPATH=`pwd` ${GO:=go} test `cat module-name`/... >&2' > test.do
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
diff --git a/module-name.do b/module-name.do
new file mode 100644 (file)
index 0000000..8284690
--- /dev/null
@@ -0,0 +1,2 @@
+redo-ifchange go.mod
+sed -n 's/^module //p' < go.mod
diff --git a/test.do b/test.do
index 88272c21fe05182652e03a2036138c76dd8cfe34..157579144643ba817a9e4bdbbbd0b039edc532c2 100644 (file)
--- a/test.do
+++ b/test.do
@@ -1 +1,2 @@
-${GO:=go} test go.cypherpunks.ru/gocheese/v2/... >&2
+redo-ifchange module-name
+${GO:=go} test `cat module-name`/... >&2