]> Cypherpunks.ru repositories - goredo.git/commitdiff
Move tai64nlocal to tai64n module v0.4.1
authorSergey Matveev <stargrave@stargrave.org>
Thu, 10 Dec 2020 16:45:03 +0000 (19:45 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 10 Dec 2020 16:45:03 +0000 (19:45 +0300)
README
go.mod
go.sum
main.go
tai64n.go [deleted file]
usage.go

diff --git a/README b/README
index bfd862ecafecfb99dbf289733654517354eae20d..222c94ae2ba99c09a29fd60e05393b6a1757338c 100644 (file)
--- a/README
+++ b/README
@@ -25,12 +25,12 @@ problems with the authenticity on your side, then build it manually: >
 
     $ git clone git://git.cypherpunks.ru/goredo.git
     $ cd goredo
-    $ git tag -v v0.4.0
+    $ git tag -v v0.4.1
     $ git clone git://git.cypherpunks.ru/gorecfile.git
     $ ( cd gorecfile ; git tag -v v0.3.0 )
     $ echo "replace go.cypherpunks.ru/recfile => `pwd`/gorecfile" >> go.mod
     $ git clone git://git.cypherpunks.ru/gotai64n.git
-    $ ( cd gotai64n ; git tag -v v0.1.0 )
+    $ ( cd gotai64n ; git tag -v v0.2.0 )
     $ echo "replace go.cypherpunks.ru/tai64n => `pwd`/gotai64n" >> go.mod
     $ go build
     $ ./goredo -symlinks
@@ -68,9 +68,9 @@ FEATURES                                               *goredo-features*
 * optional statusline with currently running/waiting/done jobs
 * target's stderr can be stored on the disk with TAI64N timestamp
   prefixes for each line. To convert them to localtime you can use either
-  tai64nlocal utility from daemontools (http://cr.yp.to/daemontools.html)
-  or make a symlink, to use built-in slower decoder: >
-    $ ln -s goredo tai64nlocal
+  tai64nlocal utility from daemontools (http://cr.yp.to/daemontools.html),
+  or similar one: >
+    $ go get go.cypherpunks.ru/tai64n/cmd/tai64nlocal
 
 COMMANDS                                               *goredo-commands*
 
diff --git a/go.mod b/go.mod
index f731fc58ce0f17b537158205d6c055eb88593477..7d665e77b29b2006977523107fa77e347bbd78dc 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.14
 
 require (
        go.cypherpunks.ru/recfile v0.3.0
-       go.cypherpunks.ru/tai64n v0.1.0
+       go.cypherpunks.ru/tai64n v0.2.0
        golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9
        golang.org/x/sys v0.0.0-20201117222635-ba5294a509c7
        golang.org/x/term v0.0.0-20201117132131-f5c789dd3221
diff --git a/go.sum b/go.sum
index 1a103d7b67cf3edf1e8d0aef873f9d85186c5361..c9c5695c79dadca5862120544223ec8da23d52c5 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
 go.cypherpunks.ru/recfile v0.3.0 h1:aZRMMst8hoNOIhGjCA/VxjTN5VBSEN4W4zyhWF/7xSU=
 go.cypherpunks.ru/recfile v0.3.0/go.mod h1:p1ZUMeyQQbQg+ICtKH3+Zt59QLI0tCZYZj/75Vp1buk=
-go.cypherpunks.ru/tai64n v0.1.0 h1:XT1ys6lbo4/bjDQpMA8Xu5TCx6Y6aAYYYn5G0quE8sk=
-go.cypherpunks.ru/tai64n v0.1.0/go.mod h1:mjuUq/ZQAOEKvzAAl25RIrN6JExWA4fRkOs7o7OVvYE=
+go.cypherpunks.ru/tai64n v0.2.0 h1:ox04T0m9wVngTb5tDwrPyifukr01c6iJXHHJldlMQu8=
+go.cypherpunks.ru/tai64n v0.2.0/go.mod h1:mjuUq/ZQAOEKvzAAl25RIrN6JExWA4fRkOs7o7OVvYE=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o=
 golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
diff --git a/main.go b/main.go
index 2e0778b0831c5a913a39e2c2e371f377c5010cca..818b8dafeb830d85300c397107020572bfe0c32f 100644 (file)
--- a/main.go
+++ b/main.go
@@ -18,7 +18,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package main
 
 import (
-       "bufio"
        "crypto/rand"
        "flag"
        "fmt"
@@ -91,7 +90,6 @@ func main() {
                                log.Println(err)
                        }
                }
-               fmt.Println("not creating optional:", os.Args[0], "<- tai64nlocal")
                os.Exit(rc)
        }
        log.SetFlags(0)
@@ -272,10 +270,6 @@ CmdSwitch:
                        fmt.Println(cwdMustRel(cwd, m["Target"]))
                }
                ok = doFile != ""
-       case "tai64nlocal":
-               bw := bufio.NewWriter(os.Stdout)
-               err = tai64nLocal(bw, os.Stdin)
-               bw.Flush()
        default:
                log.Fatalln("unknown command", cmdName)
        }
diff --git a/tai64n.go b/tai64n.go
deleted file mode 100644 (file)
index c427835..0000000
--- a/tai64n.go
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-goredo -- redo implementation on pure Go
-Copyright (C) 2020 Sergey Matveev <stargrave@stargrave.org>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 3 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-package main
-
-import (
-       "bufio"
-       "io"
-       "strings"
-       "time"
-
-       "go.cypherpunks.ru/tai64n"
-)
-
-func tai64nLocal(dst io.StringWriter, src io.Reader) error {
-       scanner := bufio.NewScanner(src)
-       var err error
-       var s string
-       var sep int
-       var t time.Time
-       for {
-               if !scanner.Scan() {
-                       if err = scanner.Err(); err != nil {
-                               return err
-                       }
-                       break
-               }
-               s = scanner.Text()
-
-               if s[0] != '@' {
-                       dst.WriteString(s + "\n")
-               }
-               sep = strings.IndexByte(s, byte(' '))
-               if sep == -1 {
-                       dst.WriteString(s + "\n")
-               }
-               t, err = tai64n.Decode(s[1:sep])
-               if err != nil {
-                       return err
-               }
-               dst.WriteString(t.Format(tai64n.LocalFmt) + s[sep:] + "\n")
-       }
-       return nil
-}
index 7670f7615212d580e29384497ac9f99e02f75d41..2113491f7e6d8d8bba01d305ca00b6ec1ed65a80 100644 (file)
--- a/usage.go
+++ b/usage.go
@@ -26,7 +26,7 @@ import (
 )
 
 const (
-       Version  = "0.4.0"
+       Version  = "0.4.1"
        Warranty = `This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, version 3 of the License.