mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-25 20:26:34 +00:00
utils/test-pkg: generate package config if it is not specified
It is possible to generate one-line config for the package just by normalize it to the form: BR2_PACKAGE_${pkg_replaced-to_and_uppercase} it simplifes a bit of testing package where no additional config options are needed. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit a946813dd581ac2e1aea6745edad2bc7ce44e6aa) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
18ae511d81
commit
6cfd314ed3
@ -2,12 +2,20 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
|
TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
|
||||||
|
TEMP_CONF=""
|
||||||
|
|
||||||
|
do_clean() {
|
||||||
|
if [ ! -z "${TEMP_CONF}" ]; then
|
||||||
|
rm -f "${TEMP_CONF}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local o O opts
|
local o O opts
|
||||||
local cfg dir pkg random toolchains_dir toolchain all number mode
|
local cfg dir pkg random toolchains_dir toolchain all number mode
|
||||||
local ret nb nb_skip nb_fail nb_legal nb_tc build_dir
|
local ret nb nb_skip nb_fail nb_legal nb_tc build_dir
|
||||||
local -a toolchains
|
local -a toolchains
|
||||||
|
local pkg_br_name
|
||||||
|
|
||||||
o='hac:d:n:p:r:t:'
|
o='hac:d:n:p:r:t:'
|
||||||
O='help,config-snippet:build-dir:package:,random:,toolchains-dir:'
|
O='help,config-snippet:build-dir:package:,random:,toolchains-dir:'
|
||||||
@ -50,8 +58,15 @@ main() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
trap do_clean INT TERM HUP EXIT
|
||||||
|
|
||||||
if [ -z "${cfg}" ]; then
|
if [ -z "${cfg}" ]; then
|
||||||
printf "error: no config snippet specified\n" >&2; exit 1
|
pkg_br_name="${pkg//-/_}"
|
||||||
|
pkg_br_name="BR2_PACKAGE_${pkg_br_name^^}"
|
||||||
|
TEMP_CONF=$(mktemp /tmp/test-${pkg}-config.XXXXXX)
|
||||||
|
echo "${pkg_br_name}=y" > ${TEMP_CONF}
|
||||||
|
cfg="${TEMP_CONF}"
|
||||||
fi
|
fi
|
||||||
if [ ! -e "${cfg}" ]; then
|
if [ ! -e "${cfg}" ]; then
|
||||||
printf "error: %s: no such file\n" "${cfg}" >&2; exit 1
|
printf "error: %s: no such file\n" "${cfg}" >&2; exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user