]> Cypherpunks repositories - nncp.git/commitdiff
Unify redirection operator usage
authorSergey Matveev <stargrave@stargrave.org>
Tue, 23 Jul 2024 09:14:18 +0000 (12:14 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 23 Jul 2024 09:21:27 +0000 (12:21 +0300)
22 files changed:
doc/admin.texi
doc/building.texi
doc/cmd/nncp-bundle.texi
doc/cmd/nncp-cfgdir.texi
doc/cmd/nncp-cfgenc.texi
doc/cmd/nncp-cfgmin.texi
doc/cmd/nncp-cfgnew.texi
doc/cmd/nncp-exec.texi
doc/cmd/nncp-pkt.texi
doc/default.plantuml.txt.do
doc/integration/freqindex.texi
doc/integrity.texi
doc/sendmail.sh
makedist
ports/nncp/files/pkg-message.in
src/cmd/nncp-bundle/main.go
src/cmd/nncp-cfgdir/main.go
src/cmd/nncp-cfgenc/main.go
src/cmd/nncp-rm/main.go
src/toss_test.go
t/nncp-rm.t
version

index 47e0e3e1c0a9ac8812bb805e92660657bef0b5b3..dcb6b1840a8d8dc000a5f9f8ccae0670cfa4ba17 100644 (file)
@@ -44,7 +44,7 @@ NNCP uses following files/directories you should be aware of:
 $ chgrp nncp /usr/local/etc/nncp.hjson /var/spool/nncp
 $ chmod g+r /usr/local/etc/nncp.hjson
 $ chmod g+rwxs /var/spool/nncp
-$ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson
+$ echo 'umask: "007"' >>/usr/local/etc/nncp.hjson
 @end example
 
 @item
@@ -84,13 +84,13 @@ $ echo 'umask: "007"' >> /usr/local/etc/nncp.hjson
 # mkdir -p /var/service/.nncp-toss/log
 # cd /var/service/.nncp-toss
 
-# cat > run <<EOF
+# cat >run <<EOF
 #!/bin/sh -e
 exec 2>&1
 exec setuidgid uucp /usr/local/bin/nncp-toss -cycle 10
 EOF
 
-# cat > log/run <<EOF
+# cat >log/run <<EOF
 #!/bin/sh -e
 exec setuidgid uucp multilog t ./main
 EOF
@@ -119,13 +119,13 @@ uucp      stream  tcp6    nowait  nncpuser        /usr/local/bin/nncp-daemon      nncp-daemon -quiet -
 # mkdir -p /var/service/.nncp-daemon/log
 # cd /var/service/.nncp-daemon
 
-# cat > run <<EOF
+# cat >run <<EOF
 #!/bin/sh -e
 NNCPLOG=FD:4 exec envuidgid nncpuser tcpserver -DHRU -l 0 ::0 uucp \
        /usr/local/bin/nncp-daemon -quiet -ucspi 4>&1
 EOF
 
-# cat > log/run <<EOF
+# cat >log/run <<EOF
 #!/bin/sh -e
 exec setuidgid uucp multilog ./main
 EOF
index 3dd5fcb245c1771fb6df8759377aebb047a1f0c2..3e8b5b9bf22779231496a06d6bf3e5e0e5480945 100644 (file)
@@ -20,7 +20,7 @@ Go can be installed from packages or
 $ [fetch|wget] http://www.nncpgo.org/download/nncp-@value{VERSION}.tar.xz
 $ [fetch|wget] http://www.nncpgo.org/download/nncp-@value{VERSION}.tar.xz.@{asc,sig@}
 [verify signature]
-$ xz -d < nncp-@value{VERSION}.tar.xz | tar xf -
+$ xz -d <nncp-@value{VERSION}.tar.xz | tar xf -
 $ cd nncp-@value{VERSION}
 [optionally edit config]
 $ bin/build
index 853f06f6370d13bac251e613f088c4537ead36b2..1fd14ec7cdcbc0c8fad19e4cb36e89b2d13145b8 100644 (file)
@@ -3,9 +3,9 @@
 @section nncp-bundle
 
 @example
-$ nncp-bundle [options] -tx [-delete] NODE [NODE @dots{}] > @dots{}
-$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] < @dots{}
-$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] < @dots{}
+$ nncp-bundle [options] -tx [-delete] NODE [NODE @dots{}] >@dots{}
+$ nncp-bundle [options] -rx -delete [-dryrun] [NODE @dots{}] <@dots{}
+$ nncp-bundle [options] -rx [-check] [-dryrun] [NODE @dots{}] <@dots{}
 @end example
 
 With @option{-tx} option, this command creates @ref{Bundles, bundle} of
index 0750ade2538953e824362257e696ad04dce5dcca..0ce48cafd3c42d0895ef57e46480c76775ddf89f 100644 (file)
@@ -4,7 +4,7 @@
 
 @example
 $ nncp-cfgdir [options] [-cfg @dots{}] -dump /path/to/dir
-$ nncp-cfgdir [options] -load /path/to/dir > cfg.hjson
+$ nncp-cfgdir [options] -load /path/to/dir >cfg.hjson
 @end example
 
 @option{-dump} option dumps current configuration file to the
index 02070c352eba65592e434c53c9d2fe17a3c3369a..ec5aaeee42d64d5b68d93a58d8e17149da04dd83 100644 (file)
@@ -3,8 +3,8 @@
 @section nncp-cfgenc
 
 @example
-$ nncp-cfgenc [options] [-s INT] [-t INT] [-p INT] cfg.hjson > cfg.hjson.eblob
-$ nncp-cfgenc [options] -d cfg.hjson.eblob > cfg.hjson
+$ nncp-cfgenc [options] [-s INT] [-t INT] [-p INT] cfg.hjson >cfg.hjson.eblob
+$ nncp-cfgenc [options] -d cfg.hjson.eblob >cfg.hjson
 @end example
 
 This command allows you to encrypt provided @file{cfg.hjson} file with
index 91043cb10081fd68d1f760361effa4e20a8a84a9..32b2db2f9d089d5176466bcd0e620c1281a3b424 100644 (file)
@@ -5,7 +5,7 @@
 @section nncp-cfgmin
 
 @example
-$ nncp-cfgmin [options] > stripped.hjson
+$ nncp-cfgmin [options] >stripped.hjson
 @end example
 
 Print out stripped configuration version: only path to @ref{Spool,
index ccd47c6ab1e947c4d7cf1d948bb6e114d602b51f..9d14f9a8b93c680639653fc68c86745b5c2552cb 100644 (file)
@@ -3,7 +3,7 @@
 @section nncp-cfgnew
 
 @example
-$ nncp-cfgnew [options] [-area NAME] [-yggdrasil] [-nocomments] > new.hjson
+$ nncp-cfgnew [options] [-area NAME] [-yggdrasil] [-nocomments] >new.hjson
 @end example
 
 Generate new node configuration: private keys, example configuration
index 8b9c7537c0a4100ab9f8bf48944185a5f6e1bb11..02263517297a8e515ce8844473d4e00c5c3b3631 100644 (file)
@@ -19,7 +19,7 @@ node:
 @verbatim
 exec: {
   sendmail: [/usr/sbin/sendmail, "-t"]
-  appender: ["/bin/sh", "-c", "cat >> /append"]
+  appender: ["/bin/sh", "-c", "cat >>/append"]
 }
 @end verbatim
 
index ab0495a86b6fe794bbf61eb044a0805ea02a565e..7f9447865ceabfd56893a5e08da9d89290630906 100644 (file)
@@ -3,8 +3,8 @@
 @section nncp-pkt
 
 @example
-$ nncp-pkt [options] < pkt
-$ nncp-pkt [options] [-decompress] -dump < pkt > payload
+$ nncp-pkt [options] <pkt
+$ nncp-pkt [options] [-decompress] -dump <pkt >payload
 $ nncp-pkt -overheads
 @end example
 
index 917366aac263ecfba84b7d6b56a868ef656145df..5d866941dce6197d4aa9e33b2b3b519a072d66ca 100644 (file)
@@ -1,4 +1,4 @@
 src=${1%.txt}
 redo-ifchange $src ../config
 . ../config
-$PLANTUML -tutxt -pipe < $src
+$PLANTUML -tutxt -pipe <$src
index 68f5e27ef6f8a14b958d1ba6346a64823e70388c..b31515acc090151b821cc494024bae85599745b6 100644 (file)
@@ -10,7 +10,7 @@ for files in it:
 @example
 0  4  *  *  *  cd /storage ; tmp=`mktemp` ; \
     tree -f -h -N --du --timefmt \%Y-\%m-\%d |
-    zstdmt -19 > $tmp && chmod 644 $tmp && mv $tmp TREE.txt.zst ; \
+    zstdmt -19 >$tmp && chmod 644 $tmp && mv $tmp TREE.txt.zst ; \
     tree -J -f --timefmt \%Y-\%m-\%d |
-    zstdmt -19 > $tmp && chmod 644 $tmp && mv $tmp TREE.json.zst
+    zstdmt -19 >$tmp && chmod 644 $tmp && mv $tmp TREE.json.zst
 @end example
index f09b5e8ad4c516efb7635b1b5ce6dc8f7b9c6e2f..739db18529ad6ecfad7248de4f184c4a57aeff39 100644 (file)
@@ -38,7 +38,7 @@ $ gpg --auto-key-locate  wkd --locate-keys releases at nncpgo dot org
 
 @example
 $ ssh-keygen -Y verify -f PUBKEY-SSH.pub -I releases@@nncpgo.org -n file \
-    -s nncp-@value{VERSION}.tar.zst.sig < nncp-@value{VERSION}.tar.zst
+    -s nncp-@value{VERSION}.tar.zst.sig <nncp-@value{VERSION}.tar.zst
 @end example
 
 @end table
index b826091de9457daaa8e36a1f7ef1f9725b4bf152..f6d46949e78bce2ba409aab7a778e609a1974429 100755 (executable)
@@ -2,5 +2,5 @@
 
 tmp=`mktemp`
 trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
-cat > $tmp
-sendmail -f "`reformail -x Return-Path: < $tmp`" $@ < $tmp
+cat >$tmp
+sendmail -f "`reformail -x Return-Path: <$tmp`" $@ <$tmp
index 749e52339e45f3a2dba71af63991511423f63d79..f0b84f161b22837ae0fe61b9c279c88f21bae751 100755 (executable)
--- a/makedist
+++ b/makedist
@@ -9,7 +9,7 @@ release=$1
 git clone . $tmp/nncp-$release
 cd $tmp/nncp-$release
 git checkout v$release
-./version > VERSION
+./version >VERSION
 cd src
 go mod vendor
 modvendor -v -copy="**/*_test.go **/words.go **/README.md **/main.go"
@@ -36,7 +36,7 @@ find . \( \
     -name .goreleaser.yml -o \
     -name .gitattributes \) -delete
 
-cat > doc/download.texi <<EOF
+cat >doc/download.texi <<EOF
 @node Tarballs
 @section Prepared tarballs
 You can obtain releases source code prepared tarballs from
@@ -58,29 +58,29 @@ mkinfo() {
         -D "VERSION `cat VERSION`" $@
 }
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle NEWS
 @node News
 @unnumbered News
-`sed -n '6,$p' < doc/news.texi`
+`sed -n '6,$p' <doc/news.texi`
 @bye
 EOF
 mkinfo --output NEWS $texi
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle NEWS.RU
 @node Новости
 @unnumbered Новости
-`sed -n '3,$p' < doc/news.ru.texi | sed 's/^@subsection/@section/'`
+`sed -n '3,$p' <doc/news.ru.texi | sed 's/^@subsection/@section/'`
 @bye
 EOF
 mkinfo --output NEWS.RU $texi
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle INSTALL
@@ -89,7 +89,7 @@ cat > $texi <<EOF
 EOF
 mkinfo --output INSTALL $texi
 
-cat > $texi <<EOF
+cat >$texi <<EOF
 \input texinfo
 @documentencoding UTF-8
 @settitle THANKS
@@ -123,7 +123,7 @@ meta4-create -fn "$tarball" -mtime "$tarball" \
     -sig-pgp "$tarball".asc -sig-ssh "$tarball".sig \
     http://www.nncpgo.org/download/"$tarball" \
     http://y.www.nncpgo.org/download/"$tarball" \
-    https://nncp.mirrors.quux.org/download/"$tarball" < "$tarball" > "$tarball".meta4
+    https://nncp.mirrors.quux.org/download/"$tarball" <"$tarball" >"$tarball".meta4
 
 size=$(( $(stat -f %z $tarball) / 1024 ))
 release_date=$(date "+%Y-%m-%d")
index de4eb3fc1b5f2020e864172cd0e5bc368c1fba0a..db579d878fc6771d4b0b1c50430ff34d9db6308a 100644 (file)
@@ -15,7 +15,7 @@
 - Generate NNCP configuration file using the command:
 
     # umask 077
-    # nncp-cfgnew > %%PREFIX%%/etc/nncp.hjson
+    # nncp-cfgnew >%%PREFIX%%/etc/nncp.hjson
 EOM
 }
 ]
index 4f82ff004bdb6aa2de4db81282be884c9be0935d..861d31544bfd804b8f2e64c8e047a24b80e893e9 100644 (file)
@@ -37,9 +37,9 @@ import (
 
 func usage() {
        fmt.Fprint(os.Stderr, "nncp-bundle -- Create/digest stream of NNCP encrypted packets\n\n")
-       fmt.Fprintf(os.Stderr, "Usage: %s [options] -tx [-delete] NODE [NODE ...] > ...\n", os.Args[0])
-       fmt.Fprintf(os.Stderr, "       %s [options] -rx -delete [-dryrun] [NODE ...] < ...\n", os.Args[0])
-       fmt.Fprintf(os.Stderr, "       %s [options] -rx [-check] [-dryrun] [NODE ...] < ...\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "Usage: %s [options] -tx [-delete] NODE [NODE ...] >...\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "       %s [options] -rx -delete [-dryrun] [NODE ...] <...\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "       %s [options] -rx [-check] [-dryrun] [NODE ...] <...\n", os.Args[0])
        fmt.Fprintln(os.Stderr, "Options:")
        flag.PrintDefaults()
 }
index 2367740241197ea3373b609be29377acc92b45e1..66246d11ef5ed148b2684e55d19985b567a80483 100644 (file)
@@ -29,7 +29,7 @@ import (
 func usage() {
        fmt.Fprint(os.Stderr, "nncp-cfgdir -- Convert configuration file to the directory layout.\n\n")
        fmt.Fprintf(os.Stderr, "Usage: %s [options] [-cfg ...] -dump /path/to/dir\n", os.Args[0])
-       fmt.Fprintf(os.Stderr, "       %s [options] -load /path/to/dir > cfg.hjson\nOptions:\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "       %s [options] -load /path/to/dir >cfg.hjson\nOptions:\n", os.Args[0])
        flag.PrintDefaults()
 }
 
index a8559b157685a24fac5114cb21b18ee382b824ba..305f669954789f82bfad5ace40ad23dffdffddf7 100644 (file)
@@ -32,8 +32,8 @@ import (
 
 func usage() {
        fmt.Fprint(os.Stderr, "nncp-cfgenc -- encrypt/decrypt configuration file\n\n")
-       fmt.Fprintf(os.Stderr, "Usage: %s [options] cfg.hjson > cfg.hjson.eblob\n", os.Args[0])
-       fmt.Fprintf(os.Stderr, "       %s [options] -d cfg.hjson.eblob > cfg.hjson\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "Usage: %s [options] cfg.hjson >cfg.hjson.eblob\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "       %s [options] -d cfg.hjson.eblob >cfg.hjson\n", os.Args[0])
        fmt.Fprintf(os.Stderr, "       %s [options] -dump cfg.hjson.eblob\n", os.Args[0])
        fmt.Fprintln(os.Stderr, "Options:")
        flag.PrintDefaults()
index 5f309055e5a1f5f81a3d99aa34d39852a88cf1f2..c723c47704e14c14b168bfbd490d3ec60d52d2b3 100644 (file)
@@ -42,7 +42,7 @@ func usage() {
        fmt.Fprintf(os.Stderr, "       %s [options] [-older X] {-all|-node NODE} -nock\n", os.Args[0])
        fmt.Fprintf(os.Stderr, "       %s [options] [-older X] {-all|-node NODE} -area\n", os.Args[0])
        fmt.Fprintf(os.Stderr, "       %s [options] [-older X] {-all|-node NODE} {-rx|-tx} [-hdr]\n", os.Args[0])
-       fmt.Fprintf(os.Stderr, "       %s [options] {-all|-node NODE} -pkt < ...\n", os.Args[0])
+       fmt.Fprintf(os.Stderr, "       %s [options] {-all|-node NODE} -pkt <...\n", os.Args[0])
        fmt.Fprintf(os.Stderr, "       %s [options] {-all|-node NODE} -ack\n", os.Args[0])
        fmt.Fprintln(os.Stderr, "-older option's time units are: (s)econds, (m)inutes, (h)ours, (d)ays")
        fmt.Fprintln(os.Stderr, "Options:")
index 3ff63e0fe9cf055a04d7ac5e51c7e3165b3a4b03..6bdf3cfc6de3ba67d0b590a25f475757b9c7cc14 100644 (file)
@@ -122,7 +122,7 @@ func TestTossExec(t *testing.T) {
                        ctx.Neigh[*nodeOur.Id].Exec[handle] = []string{
                                "/bin/sh", "-c",
                                fmt.Sprintf(
-                                       "echo $NNCP_NICE $0 $1 >> %s ; cat >> %s",
+                                       "echo $NNCP_NICE $0 $1 >>%s ; cat >>%s",
                                        filepath.Join(spool, "mbox"),
                                        filepath.Join(spool, "mbox"),
                                ),
index aa7cc83d3926c0e478a3e7c79b5c166a19fd11ab..b264b14eef956ab416c4ca7f1247ab0cada17007 100755 (executable)
@@ -46,13 +46,13 @@ assert_is_deleted() {
 }
 
 now=`date +%s`
-nncp-cfgnew > cfg
+nncp-cfgnew >cfg
 nncp-cfgdir -cfg cfg -dump cfgdir
-echo "$PWD/spool" > cfgdir/spool
-echo "$PWD/log" > cfgdir/log
+echo "$PWD/spool" >cfgdir/spool
+echo "$PWD/log" >cfgdir/log
 neigh=`rand32`
 mkdir -p cfgdir/neigh/neigh
-for w in id exchpub signpub ; do echo $neigh > cfgdir/neigh/neigh/$w ; done
+for w in id exchpub signpub ; do echo $neigh >cfgdir/neigh/neigh/$w ; done
 mkdir -p spool/tmp spool/$neigh/rx/hdr spool/$neigh/rx/seen spool/$neigh/tx/hdr
 date_old=$(date -j -f %s +%FT%T $(( $now - (3600 * 24 * 7) )))
 
diff --git a/version b/version
index 7e6282e83b871e86087a227f7dc2910ebe9d7da7..c2dad69df33fe9ae6c1e064ef3bc0bc25270951e 100755 (executable)
--- a/version
+++ b/version
@@ -1,3 +1,3 @@
 #!/bin/sh -e
 
-exec perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' < "$(realpath -- $(dirname "$0"))"/src/nncp.go
+exec perl -ne 'print "$1\n" if /Version.* = "(.*)"$/' <"$(realpath -- $(dirname "$0"))"/src/nncp.go