2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
9 DEBUG=${ARVADOS_DEBUG:-0}
10 STDOUT_IF_DEBUG=/dev/null
11 STDERR_IF_DEBUG=/dev/null
12 if [[ "$DEBUG" != "0" ]]; then
13 STDOUT_IF_DEBUG=/dev/stdout
14 STDERR_IF_DEBUG=/dev/stderr
17 target="$(basename "$0" .sh)"
18 target="${target##*-}"
21 centos*) yum -q clean all ;;
22 rocky*) microdnf clean all ;;
26 export ARV_PACKAGES_DIR="/arvados/packages/$target"
28 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.before"
31 centos*) yum install --assumeyes -e 0 $1 ;;
32 rocky*) microdnf install $1 ;;
35 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.after"
37 diff "$ARV_PACKAGES_DIR/$1".{before,after} >"$ARV_PACKAGES_DIR/$1.diff" || true
39 # Enable any Software Collections that the package depended on.
40 if [[ -d /opt/rh ]]; then
41 # We have to stage the list to a file, because `ls | while read` would
42 # make a subshell, causing the `source` lines to have no effect.
44 ls /opt/rh >"$scl_list"
46 # SCL scripts aren't designed to run with -eu.
49 source scl_source enable "$scl"
58 rpm2cpio $(ls -t "$ARV_PACKAGES_DIR/$1"-*.rpm | head -n1) | cpio -idm 2>/dev/null
60 if [[ "$DEBUG" != "0" ]]; then
61 find -name '*.so' | while read so; do
62 echo -e "\n== Packages dependencies for $so =="
64 | awk '($3 ~ /^\//){print $3}' | sort -u | xargs rpm -qf | sort -u
68 exec /jenkins/package-testing/common-test-packages.sh "$1"