]> Cypherpunks.ru repositories - goredo.git/blobdiff - run.go
Change dependency files extension to .rec
[goredo.git] / run.go
diff --git a/run.go b/run.go
index 1dc937dedb6313a469420fafe6137194ebda262e..25e8bacebf3e20e88174412a51b5e50b0a0bc688 100644 (file)
--- a/run.go
+++ b/run.go
@@ -1,5 +1,5 @@
 /*
-goredo -- redo implementation on pure Go
+goredo -- djb's redo implementation on pure Go
 Copyright (C) 2020-2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
@@ -51,7 +51,7 @@ const (
 
        RedoDir    = ".redo"
        LockSuffix = ".lock"
-       DepSuffix  = ".dep"
+       DepSuffix  = ".rec"
        TmpPrefix  = ".redo."
        LogSuffix  = ".log"
 )
@@ -204,7 +204,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error {
                        fdDep, err := os.Open(path.Join(redoDir, tgt+DepSuffix))
                        if err != nil {
                                if os.IsNotExist(err) {
-                                       err = errors.New("was not built: no .dep")
+                                       err = errors.New("was not built: no .rec")
                                }
                                goto Finish
                        }
@@ -240,7 +240,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error {
                return nil
        }
 
-       // Start preparing .dep
+       // Start preparing .rec
        fdDep, err := tempfile(redoDir, tgt+DepSuffix)
        if err != nil {
                lockRelease()
@@ -473,7 +473,6 @@ func runScript(tgtOrig string, errs chan error, traced bool) error {
                                if err == nil && !inode.Equals(inodePrev) {
                                        runErr.Err = errors.New("$1 was explicitly touched")
                                        errs <- runErr
-                                       fd.Close()
                                        return
                                }
                        }
@@ -543,7 +542,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error {
                        }
                }
 
-               // Commit .dep
+               // Commit .rec
                if !NoSync {
                        err = fdDep.Sync()
                        if err != nil {