diff --git a/scripts/install_xrdp_build_dependencies_with_apt.sh b/scripts/install_xrdp_build_dependencies_with_apt.sh index 89b59a21..e460f612 100755 --- a/scripts/install_xrdp_build_dependencies_with_apt.sh +++ b/scripts/install_xrdp_build_dependencies_with_apt.sh @@ -4,6 +4,39 @@ set -eufx FEATURE_SET=min ARCH=amd64 +# See apt.conf(5) +DEBUG_OPTS= +#DEBUG_OPTS="$DEBUG_OPTS -oDebug::pkgProblemResolver=1" + +# Given a list of i386 packages, this call makes sure the amd64 variants +# of the development libraries are not installed +remove_64bit_libdev_packages() +{ + flags=$- + set +x ;# Disable tracing for this func + rlist="" + for p in $PACKAGES; do + # Identify packages starting with 'lib' and ending with '-dev:i386' + if [ "${p#lib}" != "$p" -a "${p%-dev:i386}" != "$p" ]; then + p64=${p%i386}amd64 + if dpkg -s $p64 >/dev/null 2>&1 ; then + rlist="$rlist ${p%i386}amd64" + fi + fi + done + if [ -n "$rlist" ]; then + echo "** Some 64-bit development packages appear to clash with i386 packages" + echo "**$rlist" + apt-get remove $rlist || : + fi + # Restore tracing, if enabled on entry + set -$flags +} + +# ---------------------------------------------------------------------------- +# M A I N +# ---------------------------------------------------------------------------- + if [ $# -ge 1 ]; then FEATURE_SET="$1" shift @@ -84,6 +117,7 @@ in dpkg --print-architecture dpkg --print-foreign-architectures apt-get update + remove_64bit_libdev_packages $PACKAGES ;; *) echo "unsupported architecture: $ARCH" @@ -95,5 +129,6 @@ apt-get update apt-get -yq \ --no-install-suggests \ --no-install-recommends \ + $DEBUG_OPTS \ $APT_EXTRA_ARGS \ install $PACKAGES