From 5ca39bfc0b769607db3f84213fc7f16f0c4019fa Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 29 Jan 2021 10:38:55 +0300 Subject: [PATCH] Change dependency files extension to .rec --- dep.go | 8 ++++---- doc/cmds.texi | 2 +- doc/faq.texi | 4 ++-- doc/news.texi | 9 +++++++++ doc/state.texi | 2 +- ood.go | 4 ++-- run.go | 8 ++++---- t/goredo-deps.t | 2 +- usage.go | 2 +- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dep.go b/dep.go index a64da9e..bbd7310 100644 --- a/dep.go +++ b/dep.go @@ -159,7 +159,7 @@ func depRead(fdDep *os.File) (*DepInfo, error) { } depInfo := DepInfo{} if b := m["Build"]; b == "" { - return nil, errors.New(".dep missing Build:") + return nil, errors.New(".rec missing Build:") } else { depInfo.build = b } @@ -177,7 +177,7 @@ func depRead(fdDep *os.File) (*DepInfo, error) { case DepTypeIfcreate: dep := m["Target"] if dep == "" { - return nil, errors.New("invalid format of .dep") + return nil, errors.New("invalid format of .rec") } depInfo.ifcreates = append(depInfo.ifcreates, dep) case DepTypeIfchange: @@ -186,11 +186,11 @@ func depRead(fdDep *os.File) (*DepInfo, error) { case DepTypeStamp: hsh := m["Hash"] if hsh == "" { - return nil, errors.New("invalid format of .dep") + return nil, errors.New("invalid format of .rec") } depInfo.stamp = hsh default: - return nil, errors.New("invalid format of .dep") + return nil, errors.New("invalid format of .rec") } } return &depInfo, nil diff --git a/doc/cmds.texi b/doc/cmds.texi index 1483b7f..abd0990 100644 --- a/doc/cmds.texi +++ b/doc/cmds.texi @@ -46,7 +46,7 @@ default.do @url{https://en.wikipedia.org/wiki/DOT_(graph_description_language), DOT} graph generator. For example to visualize your dependencies with GraphViz: @example -$ redo target [...] # to assure that **/.redo/*.dep are filled up +$ redo target [...] # to assure that **/.redo/*.rec are filled up $ redo-dot target [...] > whatever.dot $ dot -Tpng whatever.dot > whatever.png # possibly add -Gsplines=ortho @end example diff --git a/doc/faq.texi b/doc/faq.texi index 9b909a6..16fadaf 100644 --- a/doc/faq.texi +++ b/doc/faq.texi @@ -42,7 +42,7 @@ and transparently compressed, as ZFS with LZ4/Zstandard and Skein/BLAKE[23] algorithms demonstrate us. @command{goredo} includes @command{redo-stamp}, that really records the -stamp in the @file{.dep} file, but it does not play any role later. It +stamp in the @file{.rec} file, but it does not play any role later. It is stayed just for compatibility. @section Can removed .do lead to permanent errors of its non existence? @@ -52,7 +52,7 @@ assume that @file{.do}-less target now is an ordinary source-file? I have no confidence in such behaviour. So it is user's decision how to deal with it, probably it was just his inaccuracy mistake. If you really want to get rid of that dependency knowledge for @file{foo/bar} target, -then just remove @file{foo/.redo/bar.dep}. +then just remove @file{foo/.redo/bar.rec}. @section Does redo-always always rebuilds target? diff --git a/doc/news.texi b/doc/news.texi index 99faeda..7f67ba9 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -1,6 +1,15 @@ @node News @unnumbered News +@anchor{Release 1.2.0} +@section Release 1.2.0 +@itemize +@item + Dependency files @file{.dep} extension changed to @file{.rec}, to + reflect its recfile format nature and editors file type better + determination. +@end itemize + @anchor{Release 1.1.0} @section Release 1.1.0 @itemize diff --git a/doc/state.texi b/doc/state.texi index fa7c28c..4c84b41 100644 --- a/doc/state.texi +++ b/doc/state.texi @@ -3,7 +3,7 @@ Dependency and build state is kept inside @file{.redo} subdirectory in each directory related the build. Each corresponding target has its own, -recreated with every rebuild, @file{.dep} file. It is +recreated with every rebuild, @file{.rec} file. It is @url{https://www.gnu.org/software/recutils/, recfile}, that could have various dependency information. For example: diff --git a/ood.go b/ood.go index 912b6c6..0552e20 100644 --- a/ood.go +++ b/ood.go @@ -110,11 +110,11 @@ func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, erro for _, m := range depInfo.ifchanges { dep := m["Target"] if dep == "" { - return ood, TgtErr{tgtOrig, errors.New("invalid format of .dep: missing Target")} + return ood, TgtErr{tgtOrig, errors.New("invalid format of .rec: missing Target")} } theirInode, err := inodeFromRec(m) if err != nil { - return ood, TgtErr{tgtOrig, fmt.Errorf("invalid format of .dep: %v", err)} + return ood, TgtErr{tgtOrig, fmt.Errorf("invalid format of .rec: %v", err)} } theirHsh := m["Hash"] trace(CDebug, "ood: %s%s -> %s: checking", indent, tgtOrig, dep) diff --git a/run.go b/run.go index f6a9042..25e8bac 100644 --- a/run.go +++ b/run.go @@ -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() @@ -542,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 { diff --git a/t/goredo-deps.t b/t/goredo-deps.t index 2e3ca5e..5ab869c 100755 --- a/t/goredo-deps.t +++ b/t/goredo-deps.t @@ -28,7 +28,7 @@ test_expect_success Rebuild "redo-ifchange sub/index.html" stat2=`stat sub/index.html` test_expect_success "Was not rebuild" '[ "$stat1" = "$stat2" ]' -tgts=`sed -n "s/^Target: //p" sub/.redo/index.html.dep | sort` +tgts=`sed -n "s/^Target: //p" sub/.redo/index.html.rec | sort` tgts=`echo $tgts` tgts_expected="../default.html.do" # .do itself tgts_expected="$tgts_expected default.do" # ifcreate diff --git a/usage.go b/usage.go index d31db40..affd454 100644 --- a/usage.go +++ b/usage.go @@ -26,7 +26,7 @@ import ( ) const ( - Version = "1.1.0" + Version = "1.2.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. -- 2.44.0