Files
swift-mirror/test/Inputs/process_fine_grained_swiftdeps_with_fingerprints.sh
2020-01-28 20:06:44 -08:00

8 lines
483 B
Bash
Executable File

#!/usr/bin/env sh
# Fine-grained swiftdeps files use multiple lines for each graph node.
# Compress such a file so that each entry is one line of the form:
# <kind> <aspect> <context> <name> <isProvides>
# Also sort for consistency, since the node order can vary.
awk '/kind:/ {k = $2; f = "<no fingerprint>"}; /aspect:/ {a = $2}; /context:/ {c = $2}; /name/ {n = $2}; /sequenceNumber/ {s = $2}; /fingerprint:/ {f = $2 }; /isProvides:/ {isP = $2; print k, a, c, n, isP, f}' | sort