Skip to content

Commit

Permalink
Use 'upgrade' instead of 'update'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrews committed Mar 31, 2023
1 parent cebaf9a commit 8fac1c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ansible_builder/_target_scripts/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mkdir -p /tmp/src

cd /tmp/src

$PKGMGR update -y
$PKGMGR upgrade -y

function install_bindep {
# Protect from the bindep builder image use of the assemble script
Expand Down Expand Up @@ -96,7 +96,7 @@ function install_wheels {
# possible to tell what is the wheel for the project and
# what is the wheel cache.
if [ -f setup.py ] ; then
python3 setup.py sdist bdist_wheel -d /output/wheels
$PYCMD setup.py sdist bdist_wheel -d /output/wheels
fi

# Install everything so that the wheel cache is populated with
Expand Down Expand Up @@ -143,7 +143,7 @@ done
# NOTE(pabelanger): We allow users to install distro python packages of
# libraries. This is important for projects that eventually want to produce
# an RPM or offline install.
python3 -m venv /tmp/venv --system-site-packages --without-pip
$PYCMD -m venv /tmp/venv --system-site-packages --without-pip
source /tmp/venv/bin/activate

# If there is an upper-constraints.txt file in the source tree,
Expand Down
18 changes: 11 additions & 7 deletions ansible_builder/_target_scripts/install-from-bindep
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ if [ -z $PKGMGR ]; then
PKGMGR=/usr/bin/dnf
if [ -f "/usr/bin/microdnf" ]; then
PKGMGR=/usr/bin/microdnf
if [ -z $PKGMGR_OPTS ]; then
# NOTE(pabelanger): skip install docs and weak dependencies to
# make smaller images. Sadly, setting these in dnf.conf don't
# appear to work.
PKGMGR_OPTS="--nodocs --setopt install_weak_deps=0"
fi
fi
fi

$PKGMGR update -y $PKGMGR_OPTS
if [ "$PKGMGR" = "/usr/bin/microdnf" ]
then
if [ -z $PKGMGR_OPTS ]; then
# NOTE(pabelanger): skip install docs and weak dependencies to
# make smaller images. Sadly, setting these in dnf.conf don't
# appear to work.
PKGMGR_OPTS="--nodocs --setopt install_weak_deps=0"
fi
fi

$PKGMGR upgrade -y $PKGMGR_OPTS

if [ -f /output/bindep/run.txt ] ; then
PACKAGES=$(cat /output/bindep/run.txt)
Expand Down
2 changes: 0 additions & 2 deletions ansible_builder/containerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ def _prepare_introspect_assemble_steps(self):
introspect_cmd += " --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt"

self.steps.append(introspect_cmd)
if self.definition.version >= 3:
self.steps.append("ENV PKGMGR=$PKGMGR")
self.steps.append("RUN /output/scripts/assemble")

def _prepare_system_runtime_deps_steps(self):
Expand Down

0 comments on commit 8fac1c0

Please sign in to comment.