@@ -54,7 +54,6 @@ import (
54
54
"time"
55
55
56
56
"github.com/cespare/cp"
57
- "github.com/ethereum/go-ethereum/common"
58
57
"github.com/ethereum/go-ethereum/crypto/signify"
59
58
"github.com/ethereum/go-ethereum/internal/build"
60
59
"github.com/ethereum/go-ethereum/params"
@@ -144,7 +143,7 @@ func executablePath(name string) string {
144
143
func main () {
145
144
log .SetFlags (log .Lshortfile )
146
145
147
- if ! common .FileExist (filepath .Join ("build" , "ci.go" )) {
146
+ if ! build .FileExist (filepath .Join ("build" , "ci.go" )) {
148
147
log .Fatal ("this script must be run from the root of the repository" )
149
148
}
150
149
if len (os .Args ) < 2 {
@@ -352,8 +351,8 @@ func downloadSpecTestFixtures(csdb *build.ChecksumDB, cachedir string) string {
352
351
// hashAllSourceFiles iterates all files under the top-level project directory
353
352
// computing the hash of each file (excluding files within the tests
354
353
// subrepo)
355
- func hashAllSourceFiles () (map [string ]common. Hash , error ) {
356
- res := make (map [string ]common. Hash )
354
+ func hashAllSourceFiles () (map [string ][ 32 ] byte , error ) {
355
+ res := make (map [string ][ 32 ] byte )
357
356
err := filepath .WalkDir ("." , func (path string , d os.DirEntry , err error ) error {
358
357
if strings .HasPrefix (path , filepath .FromSlash ("tests/testdata" )) {
359
358
return filepath .SkipDir
@@ -370,7 +369,7 @@ func hashAllSourceFiles() (map[string]common.Hash, error) {
370
369
if _ , err := io .Copy (hasher , f ); err != nil {
371
370
return err
372
371
}
373
- res [path ] = common . Hash (hasher .Sum (nil ))
372
+ res [path ] = [ 32 ] byte (hasher .Sum (nil ))
374
373
return nil
375
374
})
376
375
if err != nil {
@@ -381,8 +380,8 @@ func hashAllSourceFiles() (map[string]common.Hash, error) {
381
380
382
381
// hashSourceFiles iterates the provided set of filepaths (relative to the top-level geth project directory)
383
382
// computing the hash of each file.
384
- func hashSourceFiles (files []string ) (map [string ]common. Hash , error ) {
385
- res := make (map [string ]common. Hash )
383
+ func hashSourceFiles (files []string ) (map [string ][ 32 ] byte , error ) {
384
+ res := make (map [string ][ 32 ] byte )
386
385
for _ , filePath := range files {
387
386
f , err := os .OpenFile (filePath , os .O_RDONLY , 0666 )
388
387
if err != nil {
@@ -392,14 +391,14 @@ func hashSourceFiles(files []string) (map[string]common.Hash, error) {
392
391
if _ , err := io .Copy (hasher , f ); err != nil {
393
392
return nil , err
394
393
}
395
- res [filePath ] = common . Hash (hasher .Sum (nil ))
394
+ res [filePath ] = [ 32 ] byte (hasher .Sum (nil ))
396
395
}
397
396
return res , nil
398
397
}
399
398
400
399
// compareHashedFilesets compares two maps (key is relative file path to top-level geth directory, value is its hash)
401
400
// and returns the list of file paths whose hashes differed.
402
- func compareHashedFilesets (preHashes map [string ]common. Hash , postHashes map [string ]common. Hash ) []string {
401
+ func compareHashedFilesets (preHashes map [string ][ 32 ] byte , postHashes map [string ][ 32 ] byte ) []string {
403
402
updates := []string {}
404
403
for path , postHash := range postHashes {
405
404
preHash , ok := preHashes [path ]
@@ -442,7 +441,7 @@ func doGenerate() {
442
441
protocPath := downloadProtoc (* cachedir )
443
442
protocGenGoPath := downloadProtocGenGo (* cachedir )
444
443
445
- var preHashes map [string ]common. Hash
444
+ var preHashes map [string ][ 32 ] byte
446
445
if * verify {
447
446
var err error
448
447
preHashes , err = hashAllSourceFiles ()
@@ -915,7 +914,7 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
915
914
var idfile string
916
915
if sshkey := getenvBase64 ("PPA_SSH_KEY" ); len (sshkey ) > 0 {
917
916
idfile = filepath .Join (workdir , "sshkey" )
918
- if ! common .FileExist (idfile ) {
917
+ if ! build .FileExist (idfile ) {
919
918
os .WriteFile (idfile , sshkey , 0600 )
920
919
}
921
920
}
0 commit comments