tweaks
All checks were successful
Test / Run unit tests (pull_request) Successful in 12m45s

This commit is contained in:
Roy Crihfield 2023-09-27 14:52:32 +08:00
parent e70cbb0f26
commit 59444de62d
2 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,8 @@
# Note: Top-level package code is shared, but commands are in separate modules to prevent
# go-ethereum import conflicts
ALL := dumpdiff.geth dumpdiff.plugeth dumpdiff.plugeth-parallel
dumpdiff.geth: dumpdiff-geth/*
cd dumpdiff-geth && go build -tags geth -o ../$@ .
@ -11,7 +13,7 @@ dumpdiff.plugeth-parallel:
cd dumpdiff-plugeth-parallel && go build -tags plugeth_parallel -o ../$@ .
clean:
rm -f dumpdiff.geth dumpdiff.plugeth dumpdiff.plugeth-parallel
rm -f $(ALL)
all: dumpdiff.geth dumpdiff.plugeth dumpdiff.plugeth-parallel
all: $(ALL)
.PHONY: all

View File

@ -1,6 +1,9 @@
#!/bin/sh
# Usage: update-mod.sh <plugeth-statediff-dir> <target-go.mod-dir>
PLUGETH_STATEDIFF_DIR=`echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"`
set -u
PLUGETH_STATEDIFF_DIR=$(readlink -f "$1")
TARGET_GOMOD_DIR=${2}
cd $TARGET_GOMOD_DIR
@ -17,7 +20,7 @@ if [ $? -eq 0 ]; then
go mod edit --replace "github.com/cerc-io/plugeth-statediff=${PLUGETH_STATEDIFF_DIR}"
fi
for r in `go mod edit --json ${PLUGETH_STATEDIFF_DIR}/go.mod | jq -r '.Replace[] | "\(.Old.Path)=\(.New.Path)@\(.New.Version)"'`; do
for r in $(go mod edit --json "${PLUGETH_STATEDIFF_DIR}/go.mod" | jq -r '.Replace[] | "\(.Old.Path)=\(.New.Path)@\(.New.Version)"'); do
orig=$(echo $r | cut -d'=' -f1)
rep=$(echo $r | cut -d'=' -f2 | cut -d'@' -f1)
echo "$CURRENT_REPLACEMENTS" | grep "$orig" | grep "$rep" > /dev/null
@ -28,4 +31,4 @@ for r in `go mod edit --json ${PLUGETH_STATEDIFF_DIR}/go.mod | jq -r '.Replace[]
go mod edit --replace "$r"
done
go mod tidy -e 2>/dev/null
exec go mod tidy -e 2>/dev/null