2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
8 DEBUG=${ARVADOS_DEBUG:-0}
9 STDOUT_IF_DEBUG=/dev/null
10 STDERR_IF_DEBUG=/dev/null
11 DASHQQ_UNLESS_DEBUG=-qq
12 if [[ "$DEBUG" != "0" ]]; then
13 STDOUT_IF_DEBUG=/dev/stdout
14 STDERR_IF_DEBUG=/dev/stderr
18 # Multiple .deb based distros symlink to this script, so extract the target
19 # from the invocation path.
20 target=$(echo $0 | sed 's/.*test-packages-\([^.]*\)\.sh.*/\1/')
22 export ARV_PACKAGES_DIR="/arvados/packages/$target"
24 dpkg-query --show > "$ARV_PACKAGES_DIR/$1.before"
26 apt-get $DASHQQ_UNLESS_DEBUG --allow-insecure-repositories update
28 apt-get $DASHQQ_UNLESS_DEBUG -y --allow-unauthenticated install "$1" >"$STDOUT_IF_DEBUG" 2>"$STDERR_IF_DEBUG"
30 dpkg-query --show > "$ARV_PACKAGES_DIR/$1.after"
33 diff "$ARV_PACKAGES_DIR/$1.before" "$ARV_PACKAGES_DIR/$1.after" > "$ARV_PACKAGES_DIR/$1.diff"
39 export ARV_PACKAGES_DIR="/arvados/packages/$target"
41 if [[ -f $(ls -t "$ARV_PACKAGES_DIR/$1"_*.deb 2>/dev/null | head -n1) ]] ; then
42 debpkg=$(ls -t "$ARV_PACKAGES_DIR/$1"_*.deb | head -n1)
44 debpkg=$(ls -t "$ARV_PACKAGES_DIR/processed/$1"_*.deb | head -n1)
49 if [[ "$DEBUG" != "0" ]]; then
50 while read so && [ -n "$so" ]; do
52 echo "== Packages dependencies for $so =="
53 ldd "$so" | awk '($3 ~ /^\//){print $3}' | sort -u | xargs -r dpkg -S | cut -d: -f1 | sort -u
59 exec /jenkins/package-testing/common-test-packages.sh "$1"