Skip to content

Commit

Permalink
install-deps.sh: support INSTALL_EXTRA_PKGS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
phlogistonjohn committed Feb 7, 2023
1 parent b315700 commit 8b529a0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,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 \
Expand Down Expand Up @@ -390,6 +394,9 @@ else
case "$ID" in
debian|ubuntu|devuan|elementary|softiron)
echo "Using apt-get to install dependencies"
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
Expand Down Expand Up @@ -493,6 +500,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
Expand All @@ -516,6 +526,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
;;
Expand Down

0 comments on commit 8b529a0

Please sign in to comment.