README | 10 +++++----- go.mod | 2 +- go.sum | 4 ++-- main.go | 6 ------ tai64n.go | 58 ----------------------------------------------------- usage.go | 2 +- diff --git a/README b/README index a766fc65e3fca98a90500aee3819e477552c931f20a8155e866a82c7e4169bd6..c3566925b8d8a04adbff0298b1e6449e876447824d918a9eb22edffdf71aca63 100644 --- 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 @@ * each target's stderr can be prefixed with the PID * 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 a077e0bad2b77b93b9e5dbc204cb57d921498ba01849fd6bd3114da1bb25fe30..c0c773b118bf61a46dcd642a4593d9a6682aabd0785c6fcdc02aa7adb6bf0d88 100644 --- 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 20116d4d10aefad46805aafab5bd2e07fd11f3d3f9ca232e47473111b52716c4..025679d48a46df95f15cad86ca3edefe318dbfc4c17371b95655fc3840e38a8e 100644 --- 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 8c1c4e9eee4350eef23ed7d3f49e1cc6a1e302ee8cc52c5464b4a363078be7ea..3be6489e9acefaff3f3fb5218c0c688bc89dae581e0816955fdf43164f353223 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,6 @@ package main import ( - "bufio" "crypto/rand" "flag" "fmt" @@ -91,7 +90,6 @@ rc = 1 log.Println(err) } } - fmt.Println("not creating optional:", os.Args[0], "<- tai64nlocal") os.Exit(rc) } log.SetFlags(0) @@ -272,10 +270,6 @@ } 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 index c689763dbfd0dca19fd36254dee1234817dc3f0f03b13e81278b2c58cd5646f7..0000000000000000000000000000000000000000 --- a/tai64n.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -goredo -- redo implementation on pure Go -Copyright (C) 2020 Sergey Matveev - -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 . -*/ - -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 -} diff --git a/usage.go b/usage.go index 6748463353fb7f8989a808c327aa042ff02c678f4cabff22b1df69289eeb9b96..5c01226ad78b14a103742a7f5b356a241e1771196ec1e12b6b767c5e0968b53a 100644 --- a/usage.go +++ b/usage.go @@ -26,7 +26,7 @@ "strings" ) 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.