Skip to content

Commit

Permalink
MDBF-806 - Exclude LDD for mariadb-test packages
Browse files Browse the repository at this point in the history
Improving build time by excluding the too many files of mariadb-test package from the ldd check when dependencies are collected.
  • Loading branch information
RazvanLiviuVarzaru committed Oct 8, 2024
1 parent 5bd165e commit d1b48f4
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -642,28 +642,36 @@ collect_dependencies() {
else
suffix="main"
fi

echo "-----------------" >> "./reqs-${suffix}.${old_or_new}"
echo "$p:" >> "./reqs-${suffix}.${old_or_new}"
if [ "$pkgtype" == "rpm" ] ; then
rpm -q -R "$p" | awk '{print $1}' | sort | grep -vE '/usr/bin/env|/usr/bin/bash' >> "./reqs-${suffix}.${old_or_new}"
filelist=$(rpm -ql "$p" | sort)
else
# We need sudo here for the apt-cache command, not for redirection
# shellcheck disable=SC2024
sudo apt-cache depends "$p" --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances | sort >> "./reqs-${suffix}.${old_or_new}"
filelist=$(dpkg-query -L "$p" | sort)
sudo apt-cache depends "$p" --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances | sort >> "./reqs-${suffix}.${old_or_new}"
fi
echo "====== Package $p" >> "./ldd-${suffix}.${old_or_new}"
for f in $filelist ; do
# We do want to match literally here, not as regex
# shellcheck disable=SC2076
if [[ "$f" =~ "/.build-id/" ]] ; then
continue

# Collect LDD output for files installed by the package on the system
if [[ ${p} != "mariadb-test"* ]]; then
if [ "$pkgtype" == "rpm" ] ; then
filelist=$(rpm -ql "$p" | sort)
else
filelist=$(dpkg-query -L "$p" | sort)
fi
sudo ldd "$f" > /dev/null 2>&1 || continue
echo "=== $f" >> "./ldd-${suffix}.${old_or_new}"
sudo ldd "$f" | sort | sed 's/(.*)//' >> "./ldd-${suffix}.${old_or_new}"
done
echo "====== Package $p" >> "./ldd-${suffix}.${old_or_new}"
for f in $filelist ; do
# We do want to match literally here, not as regex
# shellcheck disable=SC2076
if [[ "$f" =~ "/.build-id/" ]] ; then
continue
fi
sudo ldd "$f" > /dev/null 2>&1 || continue
echo "=== $f" >> "./ldd-${suffix}.${old_or_new}"
sudo ldd "$f" | sort | sed 's/(.*)//' >> "./ldd-${suffix}.${old_or_new}"
done
fi
done
# set -x
}

0 comments on commit d1b48f4

Please sign in to comment.