blob: dbdae5736e36a8753b904ce6ee5889922af7c548 (
plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
#!/bin/bash
#
# Copyright (C) 2022 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# For further information about the PTXdist project and license conditions
# see the README file.
#
ptxd_make_world_report_init() {
# use patchin_init for pkg_patch_dir
ptxd_make_world_patchin_init || return
pkg_license="${pkg_license:-unknown}"
ptxd_make_world_license_flags || return
pkg_section="$(ptxd_create_section_from_license "${pkg_license}")"
}
export -f ptxd_make_world_report_init
ptxd_make_world_report_yaml() {
do_echo() {
if [ -n "${2}" ]; then
echo "${1} '${2}'"
fi
}
do_list() {
if [ -n "${2}" ]; then
echo "${1}"
awk "BEGIN { RS=\" \" } { if (\$1) print \"- '\" \$1 \"'\" }" <<<"${2}"
fi
}
do_echo "name:" "${pkg_label}"
do_echo "rulefile:" "${pkg_makefile}"
do_list "extra-rulefiles:" "${pkg_extra_makefiles}"
do_echo "menufile:" "${pkg_infile}"
do_list "builddeps:" "${pkg_build_deps}"
do_list "rundeps:" "${pkg_run_deps}"
do_echo "config:" "${pkg_config}"
do_echo "version:" "${pkg_version}"
do_list "url:" "${pkg_url}"
do_echo "md5:" "${pkg_md5}"
do_echo "source:" "${pkg_src}"
if [ -n "${pkg_md5s}" ]; then
echo "md5s:"
awk "BEGIN { RS=\" *:\\\\s*\"; FS=\":\" } { if (\$1) print \"- '\" \$1 \"'\" }" <<<"${pkg_md5s}"
fi
do_list "sources:" "${pkg_srcs}"
do_echo "patches:" "${pkg_patch_dir}"
if [ "${pkg_patch_series}" != "series" -a -n "${pkg_patch_dir}" ]; then
do_echo "series:" "${pkg_patch_series}"
fi
do_echo "srcdir:" "${pkg_dir}"
do_echo "builddir:" "${pkg_build_dir}"
do_echo "pkgdir:" "${pkg_pkg_dir}"
do_echo "cfghash:" "${pkg_cfghash}"
do_echo "srchash:" "${pkg_srchash}"
if [ "$(ptxd_get_ptxconf PROJECT_CREATE_DEVPKGS)" == "y" -o \
"$(ptxd_get_ptxconf PROJECT_USE_DEVPKGS)" == "y" ]; then
do_echo "devpkg:" "${pkg_pkg_dev}"
fi
do_echo "license-section:" "${pkg_section}"
do_echo "licenses:" "${pkg_license}"
do_list "license-flags:" "${!pkg_license_flags[*]}"
if [ "${1}" != "fast" ]; then
if [ ${#pkg_license_texts[@]} -gt 0 -o ${#pkg_license_texts_guessed[@]} -gt 0 ]; then
# license files have been extracted, so add the expanded data
echo "license-files:"
fi
local guess="false"
for license in "${pkg_license_texts[@]}" - "${pkg_license_texts_guessed[@]}"; do
if [ "${license}" = "-" ]; then
guess="true"
continue
fi
cat << EOF
$(basename "${license}"):
guessed: ${guess}
file: '${license}'
md5: '$(sed -n "s/\(.*\) $(basename "${license}")\$/\1/p" "${pkg_license_dir}/license/MD5SUM")'
EOF
done
else
# license files have not been extracted, so just add the string from the rule
do_list "license-files:" "${pkg_license_files}"
fi
if [ "${1}" != "fast" -a -e "${pkg_xpkg_map}" ]; then
echo "ipkgs:"
for xpkg in $(< "${pkg_xpkg_map}"); do
echo "- '${ptx_pkg_dir}/${xpkg}_${pkg_version}_${PTXDIST_IPKG_ARCH_STRING}.ipk'"
done
fi
do_echo "image:" "${image_image}"
do_list "pkgs:" "${image_pkgs}"
do_list "files:" "${image_files}"
}
export -f ptxd_make_world_report_yaml
ptxd_make_world_fast_report() {
declare -A pkg_license_flags
ptxd_make_world_license_init || return
local -a pkg_license_texts
local -a pkg_license_texts_guessed
mkdir -p "${ptx_report_dir}/fast" &&
ptxd_make_world_report_yaml fast > "${ptx_report_dir}/fast/${pkg_label}.yaml"
}
export -f ptxd_make_world_fast_report
|