]> Cypherpunks.ru repositories - goredo.git/commitdiff
Fix workability under GNU/Linux and other systems because of different syscall v0.8.0
authorSergey Matveev <stargrave@stargrave.org>
Fri, 8 Jan 2021 12:44:10 +0000 (15:44 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 8 Jan 2021 12:53:29 +0000 (15:53 +0300)
README
dep.go
go.mod
usage.go

diff --git a/README b/README
index beb668858a62b617a044dec7ebad675ca1824c85..a35eab3de85e5246da7c737de1718af811ba3109 100644 (file)
--- a/README
+++ b/README
@@ -16,6 +16,8 @@ goredo is free software: see the file COPYING for copying conditions.
 Home page: http://www.goredo.cypherpunks.ru/
 
 INSTALL                                                 *goredo-install*
 Home page: http://www.goredo.cypherpunks.ru/
 
 INSTALL                                                 *goredo-install*
+
+Hopefully it should work on all POSIX systems.
  >
     $ go get go.cypherpunks.ru/goredo
     $ goredo -symlinks
  >
     $ go get go.cypherpunks.ru/goredo
     $ goredo -symlinks
@@ -28,7 +30,7 @@ problems with the authenticity on your side, then build it manually: >
 
     $ git clone git://git.cypherpunks.ru/goredo.git
     $ cd goredo
 
     $ git clone git://git.cypherpunks.ru/goredo.git
     $ cd goredo
-    $ git tag -v v0.7.1
+    $ git tag -v v0.8.0
     $ git clone git://git.cypherpunks.ru/gorecfile.git
     $ ( cd gorecfile ; git tag -v v0.4.0 )
     $ echo "replace go.cypherpunks.ru/recfile => `pwd`/gorecfile" >> go.mod
     $ git clone git://git.cypherpunks.ru/gorecfile.git
     $ ( cd gorecfile ; git tag -v v0.4.0 )
     $ echo "replace go.cypherpunks.ru/recfile => `pwd`/gorecfile" >> go.mod
diff --git a/dep.go b/dep.go
index a362a3840b5ded3a4b141bd85a8451bc0a624f7e..38d8bb79c200ede2acedeb9ce357fe313211d7c2 100644 (file)
--- a/dep.go
+++ b/dep.go
@@ -28,10 +28,10 @@ import (
        "os"
        "path"
        "strings"
        "os"
        "path"
        "strings"
-       "syscall"
 
        "go.cypherpunks.ru/recfile"
        "golang.org/x/crypto/blake2b"
 
        "go.cypherpunks.ru/recfile"
        "golang.org/x/crypto/blake2b"
+       "golang.org/x/sys/unix"
 )
 
 func recfileWrite(fdDep *os.File, fields ...recfile.Field) error {
 )
 
 func recfileWrite(fdDep *os.File, fields ...recfile.Field) error {
@@ -74,12 +74,11 @@ func stamp(fdDep, src *os.File) error {
 }
 
 func fileCtime(fd *os.File) (string, error) {
 }
 
 func fileCtime(fd *os.File) (string, error) {
-       fi, err := fd.Stat()
-       if err != nil {
+       var stat unix.Stat_t
+       if err := unix.Fstat(int(fd.Fd()), &stat); err != nil {
                return "", err
        }
                return "", err
        }
-       stat := fi.Sys().(*syscall.Stat_t)
-       sec, nsec := stat.Ctimespec.Unix()
+       sec, nsec := stat.Ctim.Unix()
        return fmt.Sprintf("%d.%d", sec, nsec), nil
 }
 
        return fmt.Sprintf("%d.%d", sec, nsec), nil
 }
 
diff --git a/go.mod b/go.mod
index eb7170a98c68e1e9440054b57358344de4d0f905..f6c12a95b14c5a6e259402104917ea38d2e05abb 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module go.cypherpunks.ru/goredo
 
 module go.cypherpunks.ru/goredo
 
-go 1.14
+go 1.12
 
 require (
        go.cypherpunks.ru/recfile v0.4.0
 
 require (
        go.cypherpunks.ru/recfile v0.4.0
index 9d37da365e12d1772ef287981ce83e2a7db63b10..8f0b0e591d0664cf21dbdd164c82be11565e7367 100644 (file)
--- a/usage.go
+++ b/usage.go
@@ -26,7 +26,7 @@ import (
 )
 
 const (
 )
 
 const (
-       Version  = "0.7.1"
+       Version  = "0.8.0"
        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.
        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.