From: John Mulligan Date: Mon, 3 Oct 2022 18:43:19 +0000 (-0400) Subject: install-deps.sh: support INSTALL_EXTRA_PKGS X-Git-Tag: v18.2.5~81^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=63530dfbe1f11332196e506e9f98731a4add56b4;p=ceph.git install-deps.sh: support INSTALL_EXTRA_PKGS Instead of requiring other scripts to install packages independently, teach install-deps.sh to install additional packages from the variable INSTALL_EXTRA_PKGS. Now, other scripts should just set INSTALL_EXTRA_PKGS and call install-deps.sh. In particular, this fixes an issue installing packages in a clean (ex. container) system that doesn't yet have repositories set up. Since this task is performed by install-deps.sh already we avoid a chicken-and-egg issue (or doing redundant work of setting up repos) in other scripts. Signed-off-by: John Mulligan (cherry picked from commit 8b529a0d416acd9b1fd102fd384ab0b64736e66c) --- diff --git a/install-deps.sh b/install-deps.sh index a7ce5d7a3a715..c0f90d03b63d7 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -355,6 +355,10 @@ else fi if [ x$(uname)x = xFreeBSDx ]; then + if [ "$INSTALL_EXTRA_PACKAGES" ]; then + echo "Installing extra packages not supported on FreeBSD" >&2 + exit 1 + fi $SUDO pkg install -yq \ devel/babeltrace \ devel/binutils \ @@ -423,6 +427,9 @@ else # Put this before any other invocation of apt so it can clean # up in a broken case. clean_boost_on_ubuntu + if [ "$INSTALL_EXTRA_PACKAGES" ]; then + $SUDO apt-get install -y $INSTALL_EXTRA_PACKAGES + fi $SUDO apt-get install -y devscripts equivs $SUDO apt-get install -y dpkg-dev ensure_python3_sphinx_on_ubuntu @@ -526,6 +533,9 @@ EOF fi ;; esac + if [ "$INSTALL_EXTRA_PACKAGES" ]; then + $SUDO dnf install -y $INSTALL_EXTRA_PACKAGES + fi munge_ceph_spec_in $with_seastar $with_zbd $for_make_check $DIR/ceph.spec # for python3_pkgversion macro defined by python-srpm-macros, which is required by python3-devel $SUDO dnf install -y python3-devel @@ -549,6 +559,9 @@ EOF echo "Using zypper to install dependencies" zypp_install="zypper --gpg-auto-import-keys --non-interactive install --no-recommends" $SUDO $zypp_install systemd-rpm-macros rpm-build || exit 1 + if [ "$INSTALL_EXTRA_PACKAGES" ]; then + $SUDO $zypp_install $INSTALL_EXTRA_PACKAGES + fi munge_ceph_spec_in $with_seastar false $for_make_check $DIR/ceph.spec $SUDO $zypp_install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1 ;;