X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=integrity.go;h=cc6399ef51ee00bf87c7c2bd16148c54cef37db7;hb=d7d4eec63e5866d16d08dfa729e0946b85b76c90;hp=84011fe23acafec4310d0d0892c281cdd1bd9967;hpb=db1754452806598545038fb78deae6788cae2af8;p=gocheese.git diff --git a/integrity.go b/integrity.go index 84011fe..cc6399e 100644 --- a/integrity.go +++ b/integrity.go @@ -1,6 +1,6 @@ /* GoCheese -- Python private package repository and caching proxy -Copyright (C) 2019-2021 Sergey Matveev +Copyright (C) 2019-2022 Sergey Matveev 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 @@ -64,7 +64,7 @@ func checkFile( } func goodIntegrity() bool { - dirs, err := ioutil.ReadDir(*Root) + dirs, err := ioutil.ReadDir(Root) if err != nil { log.Fatal(err) } @@ -75,7 +75,7 @@ func goodIntegrity() bool { isGood := true var pkgName string for _, dir := range dirs { - files, err := ioutil.ReadDir(filepath.Join(*Root, dir.Name())) + files, err := ioutil.ReadDir(filepath.Join(Root, dir.Name())) if err != nil { log.Fatal(err) } @@ -84,8 +84,8 @@ func goodIntegrity() bool { pkgName = strings.TrimSuffix(file.Name(), "."+HashAlgoSHA256) if !checkFile( pkgName, - filepath.Join(*Root, dir.Name(), pkgName), - filepath.Join(*Root, dir.Name(), file.Name()), + filepath.Join(Root, dir.Name(), pkgName), + filepath.Join(Root, dir.Name(), file.Name()), "SHA256", hasherSHA256, digestSHA256, ) { isGood = false @@ -96,8 +96,8 @@ func goodIntegrity() bool { pkgName = strings.TrimSuffix(file.Name(), "."+HashAlgoBLAKE2b256) if !checkFile( pkgName, - filepath.Join(*Root, dir.Name(), pkgName), - filepath.Join(*Root, dir.Name(), file.Name()), + filepath.Join(Root, dir.Name(), pkgName), + filepath.Join(Root, dir.Name(), file.Name()), "BLAKE2b-256", hasherBLAKE2b256, digestBLAKE2b256, ) { isGood = false