]> Cypherpunks.ru repositories - goredo.git/commitdiff
redo-sources do not fail at no .dep
authorSergey Matveev <stargrave@stargrave.org>
Fri, 2 Jul 2021 15:27:54 +0000 (18:27 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 2 Jul 2021 15:27:54 +0000 (18:27 +0300)
sources.go

index 0d361900527ca0aa1710e2daa7c96e8478075871..1fd4c9d0ac0bca059719e301e62224530b6392a4 100644 (file)
@@ -18,6 +18,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 package main
 
 import (
+       "log"
        "os"
        "path"
        "path/filepath"
@@ -33,6 +34,9 @@ func sourcesWalker(tgts []string) ([]string, error) {
                cwd, f := path.Split(path.Join(Cwd, tgt))
                fdDep, err := os.Open(path.Join(cwd, RedoDir, f+DepSuffix))
                if err != nil {
+                       if os.IsNotExist(err) {
+                               continue
+                       }
                        return nil, err
                }
                depInfo, err := depRead(fdDep)
@@ -48,7 +52,7 @@ func sourcesWalker(tgts []string) ([]string, error) {
                        } else if depTgtAbsPath != tgtAbsPath {
                                subSrcs, err := sourcesWalker([]string{cwdMustRel(depTgtAbsPath)})
                                if err != nil {
-                                       panic(err)
+                                       log.Fatalln(err)
                                }
                                for _, p := range subSrcs {
                                        seen[p] = struct{}{}