]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: support INSTALL_EXTRA_PKGS
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 3 Oct 2022 18:43:19 +0000 (14:43 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 18 Feb 2025 22:58:08 +0000 (17:58 -0500)
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 <jmulligan@redhat.com>
(cherry picked from commit 8b529a0d416acd9b1fd102fd384ab0b64736e66c)

install-deps.sh

index a7ce5d7a3a715fdd972a7b92729b60f2663c7353..c0f90d03b63d760c28a8f146ecd23964d47e6a51 100755 (executable)
@@ -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
         ;;