diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-09-19 14:24:55 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-09-19 15:55:58 +0200 |
commit | 9282ef9f41227231368e2c5cacc115702108fde1 (patch) | |
tree | 54c3c352ed05f151a3177345980f67eb85ac6dc3 | |
parent | 1835596d3faff7a06cf6884c409f884eabe77285 (diff) | |
download | ptxdist-9282ef9f41227231368e2c5cacc115702108fde1.tar.gz ptxdist-9282ef9f41227231368e2c5cacc115702108fde1.tar.xz |
ptxdist: add package-info command
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 10 | ||||
-rw-r--r-- | doc/ref_parameter.inc | 6 | ||||
-rw-r--r-- | rules/post/ptxd_make_world_package_info.make | 23 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_package_info.sh | 61 |
4 files changed, 100 insertions, 0 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index f8d9a7270..af98896d6 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -972,6 +972,7 @@ Misc: use 'newpackage help' for a longer description nfsroot run a userspace NFS server and export the nfsroot gdb run cross gdb with configured sysroot etc. + package-info <package> print some basic information about the package print <var> print the contents of a variable, in the way it is known by "make" list-packages print a list of all selected packages @@ -1945,6 +1946,15 @@ EOF ptxd_make_log ptxd_make_nfsd exit ;; + package-info) + declare -a pkgs + + check_config && + check_deps && + pkgs=( "${@/#/${STATEDIR}/}" ) && + ptxd_make_log "${pkgs[@]/%/.${cmd}}" + exit + ;; print) if [ ${#} -eq 0 ]; then exit 1 diff --git a/doc/ref_parameter.inc b/doc/ref_parameter.inc index 094c839b4..77f6d23b8 100644 --- a/doc/ref_parameter.inc +++ b/doc/ref_parameter.inc @@ -195,6 +195,12 @@ Misc Actions run the cross gdb from the toolchain. The sysroot and other search paths are configured to ensure that gdb finds all available debug files. +``package-info <pkg>`` + show some basic information about the package. This includes the version, + URL and various paths and directories. The paths for menu and rule file + are shown as well, to this can be used to verify that the correct version + of these files are used. + ``print <var>`` print the contents of a variable. It will first look for a shell variable with the given name. If none exists, it will run make and look if a diff --git a/rules/post/ptxd_make_world_package_info.make b/rules/post/ptxd_make_world_package_info.make new file mode 100644 index 000000000..9d7af6a88 --- /dev/null +++ b/rules/post/ptxd_make_world_package_info.make @@ -0,0 +1,23 @@ +# -*-makefile-*- +# +# Copyright (C) 2018 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +PHONY += ptx-package-info +ptx-package-info: + +world/package-info = \ + $(call world/env, $(1)) \ + ptxd_make_world_package_info + +$(STATEDIR)/%.package-info: ptx-package-info + @$(call targetinfo) + @$(call world/package-info, $(PTX_MAP_TO_PACKAGE_$(*))) + @$(call finish) + +# vim: syntax=make diff --git a/scripts/lib/ptxd_make_world_package_info.sh b/scripts/lib/ptxd_make_world_package_info.sh new file mode 100644 index 000000000..c6689a662 --- /dev/null +++ b/scripts/lib/ptxd_make_world_package_info.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Copyright (C) 2018 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +ptxd_make_world_package_info() { + ptxd_make_world_patchin_init || return + if [ -z "${pkg_version}" ]; then + ptxd_bailout "'${pkg_label}' is not a valid package" + fi + echo "package: ${pkg_label}" + echo "version: ${pkg_version}" + echo + if [ -n "${pkg_config}" ]; then + echo "config: $(ptxd_print_path "${pkg_config}")" + echo + fi + if [ -n "${pkg_license}" ]; then + echo "license: ${pkg_license}" + fi + if [ -n "${pkg_license_files}" ]; then + echo " files: ${pkg_license_files}" + fi + if [ -n "${pkg_license}" ]; then + echo + fi + if [ -n "${pkg_src}" ]; then + echo "source: $(ptxd_print_path "${pkg_src}")" + fi + if [ -n "${pkg_url}" ]; then + echo "url: ${pkg_url}" + fi + if [ -n "${pkg_src}" -o -n "${pkg_url}" ]; then + echo + fi + if [ -n "${pkg_dir}" ]; then + echo "src dir: $(ptxd_print_path "${pkg_dir}")" + fi + if [ "${pkg_build_dir}" != "${pkg_dir}" ]; then + echo "build dir: $(ptxd_print_path "${pkg_build_dir}")" + fi + if [ -n "${pkg_pkg_dir}" ]; then + echo "pkg dir: $(ptxd_print_path "${pkg_pkg_dir}")" + fi + if [ -n "${pkg_dir}" -o -n "${pkg_pkg_dir}" ]; then + echo + fi + echo "rule file: $(ptxd_print_path "${pkg_makefile}")" + echo "menu file: $(ptxd_print_path "${pkg_infile}")" + echo + if [ -n "${pkg_patch_dir}" ]; then + echo "patches: $(ptxd_print_path "${pkg_patch_dir}")" + echo + fi +} +export -f ptxd_make_world_package_info |