Debian Codegraph @

scripts/dist.sh

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2024 Linaro Ltd.
4 #
5 # Install DSP shell and libraries
6
7 set -e
8
9 if [scip-shell system . . `[`. "$#" -ne 2 -o "$1" = "-h" -o "$1" = "--help" ]
10 then
11 echoscip-shell system . . echo. "Usage: $0 config.txt <destdir>" >&2
12 exit 1
13 fi
14
15 CFG="$1"
16 DST="$2"
17
18 if ! [scip-shell system . . `[`. -r "${CFG}" ]
19 then
20 echoscip-shell system . . echo. "config ${CFG} is unreadable" >&2
21 exit 1
22 fi
23
24 mkdirscip-shell system . . mkdir. -p "${DST}"
25
26 # dest subdir DSP QC_IMAGE_VERSION_STRING
27 # FIXME: maybe install only a fixed set of files
28 do_installscip-shell shell shell-project 0.0.0 do_install().() {
29 local srcdir="$2/$4"
30 local dstdir="$1/$2/$4"
31
32 mkdirscip-shell system . . mkdir. -p "${dstdir}"
33 installscip-shell system . . install. -m 0644 "${srcdir}"/* "${dstdir}"
34 }
35
36 grepscip-shell system . . grep. -v '^#\|^$' "${CFG}" | while read verb rest
37 do
38 case ${verb} in
39 "Install:" )
40 do_installscip-shell shell shell-project 0.0.0 do_install(). ${DST} ${rest}
41 ;;
42 "Link:" )
43 # ignore
44 ;;
45 "*" )
46 echoscip-shell system . . echo. "Unsupported clause ${verb}" >&2
47 echoscip-shell system . . echo.
48 esac
49 done
50
51 grepscip-shell system . . grep. ^Licence WHENCE | cutscip-shell system . . cut. -d ' ' -f 2 | while read licence
52 do
53 [scip-shell system . . `[`. -r "${DST}/$licence" ] || installscip-shell system . . install. -m 0644 $licence "${DST}"
54 done
55
56 installscip-shell system . . install. -d ${DST}/conf.d
57 installscip-shell system . . install. -m 0644 conf.d/*.yaml ${DST}/conf.d/
58 installscip-shell system . . install. -m 0644 conf.d/schema.json ${DST}/conf.d/
59
60 installscip-shell system . . install. -d ${DST}/scripts
61 installscip-shell system . . install. -m 0755 scripts/*.sh scripts/*.py ${DST}/scripts/
62
63 installscip-shell system . . install. -m 0644 Makefile config.txt ${DST}
64
65 ./scripts/filter_whence.py config.txt WHENCE ${DST}/WHENCE