Debian Codegraph @

tools/fix-spec

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 # patch given spec file to have the correct version and declare bundled NPM dependencies
3 # Usage: fix-spec <spec-file> [version]
4 set -eu
5
6 spec="$1"
7 version="${2:-}"
8
9 ROOT_DIR=$(realpathscip-shell system . . realpath. "$(dirnamescip-shell system . . dirname. "$0")/..")
10
11 PROVIDES=$(awkscip-shell system . . awk. '{print "Provides: bundled(npm(" $1 ")) = " $2}' "${ROOT_DIR}/runtime-npm-modules.txt")
12 awkscip-shell system . . awk. -v p="$PROVIDES" 'gsub(/#NPM_PROVIDES/, p) 1' "$spec" > "$spec".new
13
14 if [scip-shell system . . `[`. -n "$version" ]; then
15 sedscip-shell system . . sed. -i '/Version/ s/\b0\b/'"$version"'/' "$spec".new
16 fi
17
18 mvscip-shell system . . mv. -f "$spec".new "$spec"