1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
From: Shengjing Zhu <zhsj@debian.org>
Date: Thu, 29 Dec 2022 23:29:54 +0800
Last-Update: 2023-12-10
Subject: Adapt regenerate.sh for packaging
Forwarded: not-needed
--- a/regenerate.sh
+++ b/regenerate.sh
@@ -22,31 +22,12 @@ function finish {
}
trap finish EXIT
-export GOBIN=${WORKDIR}/bin
-export PATH=${GOBIN}:${PATH}
-mkdir -p ${GOBIN}
-
-echo "remove existing generated files"
-# grpc_testing_not_regenerate/*.pb.go is not re-generated,
-# see grpc_testing_not_regenerate/README.md for details.
-rm -f $(find . -name '*.pb.go' | grep -v 'grpc_testing_not_regenerate')
-
-echo "go install google.golang.org/protobuf/cmd/protoc-gen-go"
-(cd test/tools && go install google.golang.org/protobuf/cmd/protoc-gen-go)
-
-echo "go install cmd/protoc-gen-go-grpc"
-(cd cmd/protoc-gen-go-grpc && go install .)
-
-echo "git clone https://github.com/grpc/grpc-proto"
-git clone --quiet https://github.com/grpc/grpc-proto ${WORKDIR}/grpc-proto
-
-echo "git clone https://github.com/protocolbuffers/protobuf"
-git clone --quiet https://github.com/protocolbuffers/protobuf ${WORKDIR}/protobuf
-
-# Pull in code.proto as a proto dependency
-mkdir -p ${WORKDIR}/googleapis/google/rpc
-echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto"
-curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > ${WORKDIR}/googleapis/google/rpc/code.proto
+mkdir -p ${WORKDIR}/grpc-proto/
+cp -r ./debian/missing-sources/grpc/grpc-proto/master/* ${WORKDIR}/grpc-proto/
+mkdir -p ${WORKDIR}/googleapis/
+cp -r ./debian/missing-sources/googleapis/googleapis/master/* ${WORKDIR}/googleapis/
+mkdir -p ${WORKDIR}/protobuf/
+cp -r ./debian/missing-sources/protocolbuffers/protobuf/main/* ${WORKDIR}/protobuf/
mkdir -p ${WORKDIR}/out
@@ -63,7 +44,7 @@ LEGACY_SOURCES=(
# Generates only the new gRPC Service symbols
SOURCES=(
- $(git ls-files --exclude-standard --cached --others "*.proto" | grep -v '^profiling/proto/service.proto$')
+ $(find -name '*.proto' | grep -v '^profiling/proto/service.proto$' | grep -v 'debian/missing-sources')
${WORKDIR}/grpc-proto/grpc/gcp/altscontext.proto
${WORKDIR}/grpc-proto/grpc/gcp/handshaker.proto
${WORKDIR}/grpc-proto/grpc/gcp/transport_security_common.proto
@@ -89,7 +70,12 @@ Mgrpc/testing/worker_service.proto=googl
Mgrpc/testing/control.proto=google.golang.org/grpc/interop/grpc_testing,\
Mgrpc/testing/test.proto=google.golang.org/grpc/interop/grpc_testing,\
Mgrpc/testing/payloads.proto=google.golang.org/grpc/interop/grpc_testing,\
-Mgrpc/testing/empty.proto=google.golang.org/grpc/interop/grpc_testing
+Mgrpc/testing/empty.proto=google.golang.org/grpc/interop/grpc_testing,\
+Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any,\
+Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,\
+Mgoogle/protobuf/struct.proto=github.com/golang/protobuf/ptypes/struct,\
+Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,\
+Mgoogle/protobuf/wrappers.proto=github.com/golang/protobuf/ptypes/wrappers
for src in ${SOURCES[@]}; do
echo "protoc ${src}"
|