2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-18 09:40:32 +00:00

fix(otherpkgs): restrict the package upgrade to the xCAT repositories

The otherpkgs postscript ran a bare "yum -y upgrade" after configuring the
xcat-otherpkgs* repositories. That upgrades every installed package from every
enabled repository, so installing a handful of extra packages could also pull
an unrelated distribution update onto the node, at provision time and without
the administrator asking for it.

Scope the upgrade to the repositories the postscript just wrote, which is what
the surrounding code already implies it does. The package install path is left
untouched, so dependencies still resolve against the full repository set.

Only the yum/dnf branch is changed. The zypper and apt branches have the same
unbounded behavior but no equivalent one-flag fix, so they are left alone
rather than half-converted.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
This commit is contained in:
Vinícius Ferrão
2026-08-06 23:26:42 -03:00
parent 32ff727e62
commit 8a22d04ff9
+5 -3
View File
@@ -877,12 +877,14 @@ EOF`
op_index=$((op_index+1))
continue
fi
#now update all the existing rpms
#now update the existing rpms that the otherpkgs repositories provide.
#Restrict the upgrade to the xcat-otherpkgs* repositories written above, so
#that running otherpkgs does not also apply unrelated distribution updates.
if [ $hasyum -eq 1 ]; then
if [ $VERBOSE ]; then
echo "$envlist $yumcmd -y upgrade"
echo "$envlist $yumcmd -y --disablerepo=* --enablerepo=xcat-otherpkgs* upgrade"
fi
result=`eval $envlist $yumcmd -y upgrade 2>&1`
result=`eval $envlist $yumcmd -y --disablerepo=* --enablerepo=xcat-otherpkgs* upgrade 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R