From 50690bcb68fd08ac452c6c88918b505350cbba90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 8 Oct 2019 00:11:23 +0200 Subject: [PATCH] fix build on eoan --- ax_init_standard_project.m4 | 2 +- bootstrap.sh | 20 +++++++++++--------- build-in-docker.sh | 23 ++++++++--------------- template.sh | 17 +++++++++-------- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index dfbd40c..369f3b2 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -962,8 +962,8 @@ AC_DEFUN([AX_PKG_CHECK], [ # $2 = pathes to search for AC_DEFUN([AX_REQUIRE_HEADER], [ AC_CHECK_HEADER($1, [], [ + found=0 if test -n "$2"; then - found=0 for d in $2; do if test -f "${d}/$1"; then AC_MSG_NOTICE([found file ${d}/$1]) diff --git a/bootstrap.sh b/bootstrap.sh index dc22024..66c2b96 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,7 @@ #! /bin/bash ## @file ## -## $Id$ +## $Id: bootstrap.sh 52 2015-11-03 15:38:21Z marc $ ## ## $Date: 2004/08/31 15:57:19 $ ## $Author: marc $ @@ -41,7 +41,7 @@ while test $# -gt 0; do (--no-vcs|-n) novcs=1;; (--exclude-vcs|-x) shift; excludevcs+=("$1");; (--version|-v) - echo "$Id$"; + echo "$Id: bootstrap.sh 52 2015-11-03 15:38:21Z marc $"; exit;; (--help|-h) less <> /etc/apt/preferences" - docker exec ${DOCKER_ID} bash -c "echo 'Pin-Priority: -100' >> /etc/apt/preferences" - 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} ${PREVENT// /- }- gnupg + if test -n "${keys[*]}"; then # fix dependency bug in cosmic and stretch + docker exec ${DOCKER_ID} apt-get install ${OPTIONS} gnupg for key in "${keys[@]}"; do wget -O- "$key" \ | docker exec -i ${DOCKER_ID} apt-key add - @@ -308,7 +301,7 @@ case "$mode" in docker exec ${DOCKER_ID} apt-get update ${OPTIONS} for package in "${packages[@]}"; do - ifthenelse "${package}" "apt-get install ${OPTIONS} ${PREVENT// /- }- ARG" + ifthenelse "${package}" "apt-get install ${OPTIONS} ARG" done for command in "${commands[@]}"; do ifthenelse "${command}" "ARG" @@ -369,7 +362,7 @@ docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${h # not supported in trusty and jessie if test "$mode" = deb -a "${img//trusty/}" = "${img}" -a "${img//jessie/}" = "${img}"; then if test "${targets//deb/}" != "${targets}" && ls *.deb > /dev/null 2> /dev/null; then - docker exec ${DOCKER_ID} bash -c "apt-get install ${OPTIONS} ${PREVENT// /- }- /workdir/*.deb" + docker exec ${DOCKER_ID} bash -c "apt-get install ${OPTIONS} /workdir/*.deb" fi fi if test "$mode" = rpm -a "${targets//rpm/}" != "${targets}"; then diff --git a/template.sh b/template.sh index beb656d..05e5e67 100755 --- a/template.sh +++ b/template.sh @@ -1,5 +1,7 @@ #!/bin/bash -e +# documentation: run with option --help + ########################################################################################## #### template for bash scripts #### START BELOW ########################################## ########################################################################################## @@ -45,25 +47,25 @@ message() { # write a success message success() { echo -n "${bold}${green}success" 1>&2 - append_msg $* 1>&2 + append_msg "$*" 1>&2 } # write a notice notice() { echo -n "${bold}${yellow}notice" 1>&2 - append_msg $* 1>&2 + append_msg "$*" 1>&2 } # write a warning message warning() { echo -en "${bold}${red}warning" 1>&2 - append_msg $* 1>&2 + append_msg "$*" 1>&2 } # write error message error() { echo -en "${bold}${red}error" 1>&2 - append_msg $* 1>&2 + append_msg "$*" 1>&2 } # run a command, print the result and abort in case of error @@ -91,9 +93,10 @@ run() { exit 1 else warning "ignored return code: $res" + return 0 fi else - success + return 1 fi } @@ -119,7 +122,6 @@ function traperror() { exit $e fi done - success exit 0 } @@ -135,7 +137,7 @@ trap 'traperror "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FU ######################################################### commandline parameter evaluation while test $# -gt 0; do case "$1" in - (--help|-h) less <