From 7fdca1e84037517fe96110119555eefa03bcd8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 10 Sep 2018 21:28:57 +0000 Subject: [PATCH] add check whether built package can be installed --- ax_init_standard_project.m4 | 15 +++++++++++---- build-in-docker.sh | 17 +++++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index b123edb..1dd5a29 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -1092,16 +1092,14 @@ AC_DEFUN([AX_DEB_DEPEND_IFEXISTS], [ # - parameter: # $1 = package name AC_DEFUN([AX_DEB_BUILD_DEPEND], [ - pkg="$1" - DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}" + DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, $1" ]) # require package in debian/control.in append @DEB_DEPEND@ to Depends # - parameter: # $1 = package name AC_DEFUN([AX_DEB_DEPEND], [ - pkg="$1" - DEB_DEPEND="${DEB_DEPEND}, ${pkg}" + DEB_DEPEND="${DEB_DEPEND}, $1" ]) # require package in debian/control.in append @DEB_DEPEND@ to Depends @@ -1203,6 +1201,15 @@ AC_DEFUN([AX_ALL_BUILD_DEPEND], [ RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}" ]) +# require package in .spec.in and control.in, append to runtime depends +# - parameter: +# $1 = package name +AC_DEFUN([AX_ALL_DEPEND], [ + pkg="$1" + DEB_DEPEND="${DEB_DEPEND}, ${pkg}" + RPM_DEPEND="${RPM_DEPEND}, ${pkg}" +]) + # require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends # - parameter: # $1 = package name diff --git a/build-in-docker.sh b/build-in-docker.sh index 53d5c8a..182fb75 100755 --- a/build-in-docker.sh +++ b/build-in-docker.sh @@ -264,7 +264,7 @@ case "$mode" in docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT// /- }- software-properties-common apt-transport-https dpkg-dev lsb-release wget || \ docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT// /- }- python-software-properties apt-transport-https dpkg-dev lsb-release wget; if [[ "${img}" =~ "ubuntu" ]]; then - docker exec ${DOCKER_ID} apt-get install ${OPTIONS} locales + docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT} locales docker exec ${DOCKER_ID} locale-gen ${LANG} docker exec ${DOCKER_ID} update-locale LANG=${LANG} fi @@ -274,7 +274,7 @@ case "$mode" in docker exec ${DOCKER_ID} bash -c "echo >> /etc/apt/preferences" done if test -n "${keys[@]}"; then # fix dependency bug in cosmic and stretch - docker exec ${DOCKER_ID} apt-get install ${OPTIONS} gnupg + docker exec ${DOCKER_ID} apt-get install ${OPTIONS} ${PREVENT} gnupg for key in "${keys[@]}"; do wget -O- "$key" \ | docker exec -i ${DOCKER_ID} apt-key add - @@ -342,3 +342,16 @@ for f in "${flags[@]}"; do done docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} "${FLAGS[@]}" + +# last check: try to install built deb or rpm files (if not already cleaned up) +if test "${targets//deb/}" != "${targets}"; then + if ls *.deb > /dev/null 2> /dev/null; then + docker exec ${DOCKER_ID} bash -c "apt-get install ${OPTIONS} ${PREVENT} /workdir/*.deb" + fi +fi +if test "${targets//rpm/}" != "${targets}"; then + if ls *.rpm > /dev/null 2> /dev/null; then + docker exec ${DOCKER_ID} bash -c "${INSTALL_TOOL} /workdir/*.rpm" + fi +fi +echo "done."