diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-07-29 20:19:07 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-07-29 22:57:11 +0200 |
commit | a84aef85fda6d4ff714d27b9882df5e8d6c77166 (patch) | |
tree | 407301922f20a58a488ae51950aa048628e463d7 | |
parent | fdee2b7f44597526da82890a5c8fad16ef46ea0a (diff) | |
download | ptxdist-a84aef85fda6d4ff714d27b9882df5e8d6c77166.tar.gz ptxdist-a84aef85fda6d4ff714d27b9882df5e8d6c77166.tar.xz |
ptxdist: add --verbose option and start using it
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-x | bin/ptxdist | 7 | ||||
-rw-r--r-- | rules/barebox.make | 1 | ||||
-rw-r--r-- | rules/busybox.make | 1 | ||||
-rw-r--r-- | rules/kernel.make | 1 | ||||
-rw-r--r-- | rules/pre/kernel.make | 1 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_image_genimage.sh | 2 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_common.sh | 6 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_compile.sh | 2 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_install.sh | 10 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_kconfig.sh | 2 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_prepare.sh | 6 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_tags.sh | 2 | ||||
-rw-r--r-- | scripts/libptxdist.sh | 22 |
13 files changed, 50 insertions, 13 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 25eb1ffa5..65789cd7d 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1113,6 +1113,7 @@ parse_first() PTXDIST_PLATFORMCONFIG="${PTXDIST_PLATFORMCONFIG_DEFAULT}" PTXDIST_COLLECTIONCONFIG="${PTXDIST_COLLECTIONCONFIG_DEFAULT}" PTXDIST_PTXCONFIG="${PTXDIST_PTXCONFIG_DEFAULT}" + PTXDIST_VERBOSE=0 # # init these ones @@ -1132,6 +1133,9 @@ parse_first() PTX_MAKE_ARGS[${#PTX_MAKE_ARGS[@]}]="--debug=make" PTX_DEBUG=true ;; + -v|--verbose) + PTXDIST_VERBOSE=1 + ;; -k) PTX_MAKE_ARGS[${#PTX_MAKE_ARGS[@]}]="-k" ;; @@ -2368,7 +2372,8 @@ setup_export() { PTXDIST_FORCE_DOWNLOAD \ PTXDIST_LOG_PROMPT \ PTXDIST_PEDANTIC \ - PTXDIST_QUIET + PTXDIST_QUIET \ + PTXDIST_VERBOSE } diff --git a/rules/barebox.make b/rules/barebox.make index 1ee660bb6..fb7abe65b 100644 --- a/rules/barebox.make +++ b/rules/barebox.make @@ -35,6 +35,7 @@ BAREBOX_CONFIG := $(call remove_quotes, $(PTXDIST_PLATFORMCONFIGDIR)/$(PTXCONF_B BAREBOX_PATH := PATH=$(CROSS_PATH) BAREBOX_ENV := KCONFIG_NOTIMESTAMP=1 BAREBOX_MAKEVARS := \ + V=$(PTXDIST_VERBOSE) \ HOSTCC=$(HOSTCC) \ ARCH=$(PTXCONF_BAREBOX_ARCH_STRING) \ CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \ diff --git a/rules/busybox.make b/rules/busybox.make index 8aebb44f2..ea38b46af 100644 --- a/rules/busybox.make +++ b/rules/busybox.make @@ -48,6 +48,7 @@ $(STATEDIR)/busybox.prepare: @$(call touch) BUSYBOX_MAKE_OPT := \ + V=$(PTXDIST_VERBOSE) \ ARCH=$(PTXCONF_ARCH_STRING) \ SUBARCH=$(PTXCONF_ARCH_STRING) \ CROSS_COMPILE=$(COMPILER_PREFIX) \ diff --git a/rules/kernel.make b/rules/kernel.make index 73a83c05f..3ee79e26d 100644 --- a/rules/kernel.make +++ b/rules/kernel.make @@ -46,6 +46,7 @@ KERNEL_PATH := PATH=$(CROSS_PATH) KERNEL_ENV := KCONFIG_NOTIMESTAMP=1 HOST_EXTRACFLAGS="$(HOST_CPPFLAGS)" KERNEL_MAKEVARS := \ $(PARALLELMFLAGS) \ + V=$(PTXDIST_VERBOSE) \ HOSTCC=$(HOSTCC) \ ARCH=$(PTXCONF_KERNEL_ARCH_STRING) \ CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) \ diff --git a/rules/pre/kernel.make b/rules/pre/kernel.make index eefdb4a54..23c0e2e18 100644 --- a/rules/pre/kernel.make +++ b/rules/pre/kernel.make @@ -51,6 +51,7 @@ kernel-url = \ kernel/opts = \ $(PARALLELMFLAGS) \ + V=$(PTXDIST_VERBOSE) \ HOSTCC=$(HOSTCC) \ ARCH=$(GENERIC_KERNEL_ARCH) \ CROSS_COMPILE=$(COMPILER_PREFIX) \ diff --git a/scripts/lib/ptxd_make_image_genimage.sh b/scripts/lib/ptxd_make_image_genimage.sh index e1587503a..742ae6ff7 100644 --- a/scripts/lib/ptxd_make_image_genimage.sh +++ b/scripts/lib/ptxd_make_image_genimage.sh @@ -60,7 +60,7 @@ ptxd_make_image_genimage_impl() { ptxd_make_extract_archive "${image_files}" "${pkg_dir}" done && - eval \ + ptxd_eval \ "${image_env}" \ genimage \ --rootpath "${pkg_dir}" \ diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh index 637c71c62..f8eca1a99 100644 --- a/scripts/lib/ptxd_make_world_common.sh +++ b/scripts/lib/ptxd_make_world_common.sh @@ -156,11 +156,11 @@ ptxd_make_world_init_compat() { esac export pkg_sysroot_dir - # pkg_env + pkg_env="SYSROOT='${pkg_sysroot_dir}' V=${PTXDIST_VERBOSE} VERBOSE=${PTXDIST_VERBOSE}" case "${pkg_type}" in - target) pkg_env="${PTXDIST_CROSS_ENV_PKG_CONFIG} SYSROOT='${pkg_sysroot_dir}'" ;; - host|cross) pkg_env="PKG_CONFIG_LIBDIR='${PTXDIST_SYSROOT_HOST}/lib/pkgconfig:${PTXDIST_SYSROOT_HOST}/share/pkgconfig' SYSROOT='${pkg_sysroot_dir}'" ;; + target) pkg_env="${PTXDIST_CROSS_ENV_PKG_CONFIG} ${pkg_env}" ;; + host|cross) pkg_env="PKG_CONFIG_LIBDIR='${PTXDIST_SYSROOT_HOST}/lib/pkgconfig:${PTXDIST_SYSROOT_HOST}/share/pkgconfig' ${pkg_env}" ;; esac } export -f ptxd_make_world_init_compat diff --git a/scripts/lib/ptxd_make_world_compile.sh b/scripts/lib/ptxd_make_world_compile.sh index b325d45b1..c859f1099 100644 --- a/scripts/lib/ptxd_make_world_compile.sh +++ b/scripts/lib/ptxd_make_world_compile.sh @@ -18,7 +18,7 @@ ptxd_make_world_compile() { return fi && - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_make_env}" \ diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh index dcb6a6125..59711c206 100644 --- a/scripts/lib/ptxd_make_world_install.sh +++ b/scripts/lib/ptxd_make_world_install.sh @@ -25,7 +25,7 @@ export -f ptxd_make_world_install_prepare # FIXME: kick ${pkg_install_env} # ptxd_make_world_install() { - local -a fakeargs + local -a fakeargs cmd ptxd_make_world_init && @@ -48,7 +48,7 @@ ptxd_make_world_install() { ptxd_make_world_install_prepare && - "${echo:-echo}" \ + cmd=( \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_make_env}" \ @@ -57,6 +57,12 @@ ptxd_make_world_install() { -C "${pkg_build_dir}" \ "${pkg_install_opt}" \ -j1 \ + ) && + + ptxd_verbose "executing:" "${cmd[@]}" && + + "${echo:-echo}" \ + "${cmd[@]}" \ | "${fakeroot:-fakeroot}" "${fakeargs[@]}" -- check_pipe_status } diff --git a/scripts/lib/ptxd_make_world_kconfig.sh b/scripts/lib/ptxd_make_world_kconfig.sh index 79b174bf7..719947de7 100644 --- a/scripts/lib/ptxd_make_world_kconfig.sh +++ b/scripts/lib/ptxd_make_world_kconfig.sh @@ -16,7 +16,7 @@ ptxd_make_kconfig() { if [ -e "${pkg_config}" ]; then cp "${pkg_config}" .config fi && - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_conf_env}" \ diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh index a1085240e..17793e258 100644 --- a/scripts/lib/ptxd_make_world_prepare.sh +++ b/scripts/lib/ptxd_make_world_prepare.sh @@ -40,7 +40,7 @@ ptxd_make_world_prepare_cmake() { [ "${pkg_type}" == "cross" ] && \ ptxd_bailout "sorry - cmake 'cross' packages are not supported" - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_conf_env}" \ @@ -58,7 +58,7 @@ ptxd_make_world_prepare_qmake() { [ "${pkg_type}" != "target" ] && \ ptxd_bailout "only qmake taget packages are supported" - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_conf_env}" \ @@ -73,7 +73,7 @@ export -f ptxd_make_world_prepare_qmake # prepare for autoconf based pkgs # ptxd_make_world_prepare_autoconf() { - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_conf_env}" \ diff --git a/scripts/lib/ptxd_make_world_tags.sh b/scripts/lib/ptxd_make_world_tags.sh index 2a04269ec..d78be27a6 100644 --- a/scripts/lib/ptxd_make_world_tags.sh +++ b/scripts/lib/ptxd_make_world_tags.sh @@ -13,7 +13,7 @@ ptxd_make_world_tags() { ptxd_make_world_init && - eval \ + ptxd_eval \ "${pkg_path}" \ "${pkg_env}" \ "${pkg_make_env}" \ diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index a6313819e..57c599b9b 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -708,6 +708,28 @@ ptxd_warning() { } export -f ptxd_warning +# +# print a message if verbose building is enabled +# the message will always be written to the logfile +# +ptxd_verbose() { + if [ "${PTXDIST_VERBOSE}" = "true" ]; then + echo "${PTXDIST_LOG_PROMPT}""${@}" >&2 + else + echo "${PTXDIST_LOG_PROMPT}""${@}" >&7 + fi +} +export -f ptxd_verbose + +# +# execute the arguments with eval +# +ptxd_eval() { + ptxd_verbose "executing:" "${@} +" + eval "${@}" +} +export -f ptxd_eval # # check if a previously executed pipe returned an error |