log-collect.sh - remove outdated code

Remove code for SUSE and Gentoo - we now unsupported this OS.

And for yum package manager, for RHEL now only dnf.

Change-Id: I86cbcf6605c394c947ffcc4c4d645ed0eac862f3
Signed-off-by: Ivan Anfimov <lazekteam@gmail.com>
This commit is contained in:
Ivan Anfimov
2025-12-23 20:29:31 +00:00
parent 47918f20d3
commit 2c7d7a662b

View File

@@ -81,29 +81,15 @@ COMMON_ETC_LOG_NAMES+=" $(awk -F'os_' '/name.*os_.*/ {print $2}' $(dirname $(rea
function repo_information {
[[ "${1}" != "host" ]] && lxc_cmd="lxc-attach --name ${1} --" || lxc_cmd=""
echo "Collecting list of installed packages and enabled repositories for \"${1}\""
# Redhat package debugging
if eval sudo ${lxc_cmd} which yum &>/dev/null || eval sudo ${lxc_cmd} which dnf &>/dev/null; then
# Prefer dnf over yum for CentOS.
eval sudo ${lxc_cmd} which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum'
eval sudo ${lxc_cmd} $RHT_PKG_MGR repolist -v > "${LOGGING_DIR}/redhat-rpm-repolist-${1}-${TS}.txt" || true
eval sudo ${lxc_cmd} $RHT_PKG_MGR list installed > "${LOGGING_DIR}/redhat-rpm-list-installed-${1}-${TS}.txt" || true
# SUSE package debugging
elif eval sudo ${lxc_cmd} which zypper &>/dev/null; then
eval sudo ${lxc_cmd} zypper lr -d > "${LOGGING_DIR}/suse-zypper-repolist-${1}-${TS}.txt" || true
eval sudo ${lxc_cmd} zypper --disable-repositories pa -i > "${LOGGING_DIR}/suse-zypper-list-installed-${1}-${TS}.txt" || true
# RHEL package debugging
if eval sudo ${lxc_cmd} which dnf &>/dev/null; then
eval sudo ${lxc_cmd} dnf repolist -v > "${LOGGING_DIR}/redhat-rpm-repolist-${1}-${TS}.txt" || true
eval sudo ${lxc_cmd} dnf list installed > "${LOGGING_DIR}/redhat-rpm-list-installed-${1}-${TS}.txt" || true
# Ubuntu package debugging
elif eval sudo ${lxc_cmd} which apt-get &> /dev/null; then
eval sudo ${lxc_cmd} apt-cache policy | grep http | awk '{print $1" "$2" "$3}' | sort -u > "${LOGGING_DIR}/ubuntu-apt-repolist-${1}-${TS}.txt" || true
eval sudo ${lxc_cmd} apt list --installed > "${LOGGING_DIR}/ubuntu-apt-list-installed-${1}-${TS}.txt" || true
# Gentoo package debugging
elif eval sudo ${lxc_cmd} which emerge &> /dev/null; then
# list installed packages
eval sudo ${lxc_cmd} equery list "*" > "${LOGGING_DIR}/gentoo-portage-list-installed-${1}-${TS}.txt" || true
# list only packages called for install (not dependancies)
eval sudo ${lxc_cmd} cat /var/lib/portage/world > "${LOGGING_DIR}/gentoo-portage-list-manual-installed-${1}-${TS}.txt" || true
fi
}