]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-bundle/main.go
Sync directories for rename assurance
[nncp.git] / src / cmd / nncp-bundle / main.go
index cdeef4fe071d18812fedd79f6af9f87a2fb5e512..60bb1130c83d09559084b633d7f5c3f9cea1c5d7 100644 (file)
@@ -32,8 +32,8 @@ import (
        "strconv"
        "strings"
 
-       "github.com/davecgh/go-xdr/xdr2"
-       "go.cypherpunks.ru/nncp/v4"
+       xdr "github.com/davecgh/go-xdr/xdr2"
+       "go.cypherpunks.ru/nncp/v5"
        "golang.org/x/crypto/blake2b"
 )
 
@@ -102,6 +102,8 @@ func main() {
                nodeIds[*node.Id] = struct{}{}
        }
 
+       ctx.Umask()
+
        sds := nncp.SDS{}
        if *doTx {
                sds["xx"] = string(nncp.TTx)
@@ -376,6 +378,9 @@ func main() {
                                        if err = os.Rename(tmp.Name(), dstPath); err != nil {
                                                log.Fatalln("Error during renaming:", err)
                                        }
+                                       if err = nncp.DirSync(selfPath); err != nil {
+                                               log.Fatalln("Error during syncing:", err)
+                                       }
                                }
                        }
                        ctx.LogI("nncp-bundle", nncp.SdsAdd(sds, nncp.SDS{