File: sync-protos.sh

package info (click to toggle)
grpc-java 1.26.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 11,852 kB
  • sloc: java: 146,813; cpp: 1,174; xml: 1,037; sh: 662; makefile: 40; python: 40
file content (30 lines) | stat: -rwxr-xr-x 878 bytes parent folder | download
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
#!/bin/bash
set -e

cd "$(dirname "$0")/.."

tmpdir="$(mktemp -d)"
curl -Ls https://github.com/grpc/grpc-proto/archive/master.tar.gz | tar xz -C "$tmpdir"
base="$tmpdir/grpc-proto-master"

# Copy protos in 'src/main/proto' from grpc-proto for these projects
for project in alts grpclb services; do
  while read -r proto; do
    [ -f "$base/$proto" ] && cp "$base/$proto" "$project/src/main/proto/$proto"
    echo "$proto"
  done < <(cd "$project/src/main/proto" && find . -name "*.proto")
done | sort > "$tmpdir/grpc-java.lst"

(cd "$base" && find . -name "*.proto") | sort > "$tmpdir/base.lst"
echo "Files synced:"
comm -12 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"

echo
echo "Files in grpc-proto not synced:"
comm -13 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"

echo
echo "Files in grpc-java not synced:"
comm -23 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"

rm -r "$tmpdir"