Skip to content

Commit 58d08f3

Browse files
committed
init: move pkg manager exclude lists to separate step, always run them.
Signed-off-by: Luca Di Maio <[email protected]>
1 parent afb3b07 commit 58d08f3

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

distrobox-init

+17-14
Original file line numberDiff line numberDiff line change
@@ -821,9 +821,6 @@ setup_apt()
821821
# shellcheck disable=SC2086,2046
822822
apt-get install -y $(apt-cache show ${deps} 2> /dev/null | grep "Package:" | sort -u | cut -d' ' -f2-)
823823

824-
# Setup hooks
825-
setup_deb_exceptions
826-
827824
# In case the locale is not available, install it
828825
# will ensure we don't fallback to C.UTF-8
829826
if [ -e /etc/locale.gen ] && {
@@ -862,8 +859,6 @@ setup_apt()
862859
# None
863860
setup_dnf()
864861
{
865-
setup_rpm_exceptions
866-
867862
manager=$1
868863

869864
# If we need to upgrade, do it and exit, no further action required.
@@ -1060,8 +1055,6 @@ EOF
10601055
# None
10611056
setup_microdnf()
10621057
{
1063-
setup_rpm_exceptions
1064-
10651058
# If we need to upgrade, do it and exit, no further action required.
10661059
if [ "${upgrade}" -ne 0 ]; then
10671060
microdnf upgrade -y
@@ -1243,9 +1236,6 @@ setup_pacman()
12431236
pacman -S --noconfirm glibc glibc-locales
12441237
fi
12451238

1246-
# Setup hooks
1247-
setup_pacman_exceptions
1248-
12491239
# Ensure we have tzdata installed and populated, sometimes container
12501240
# images blank the zoneinfo directory, so we reinstall the package to
12511241
# ensure population
@@ -1425,8 +1415,6 @@ setup_swupd()
14251415
# None
14261416
setup_xbps()
14271417
{
1428-
setup_xbps_exceptions
1429-
14301418
# If we need to upgrade, do it and exit, no further action required.
14311419
if [ "${upgrade}" -ne 0 ]; then
14321420
xbps-install -Syu
@@ -1522,8 +1510,6 @@ setup_xbps()
15221510
# None
15231511
setup_zypper()
15241512
{
1525-
setup_rpm_exceptions
1526-
15271513
# If we need to upgrade, do it and exit, no further action required.
15281514
if [ "${upgrade}" -ne 0 ]; then
15291515
zypper dup -y
@@ -1662,6 +1648,23 @@ done
16621648
# Ensure we have the least minimal path of standard Linux File System set
16631649
PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin"
16641650

1651+
# Setup pkg manager exceptions and excludes
1652+
if command -v apt-get; then
1653+
setup_deb_exceptions
1654+
elif command -v pacman; then
1655+
setup_pacman_exceptions
1656+
elif command -v xbps-install; then
1657+
setup_xbps_exceptions
1658+
elif command -v zypper; then
1659+
setup_rpm_exceptions
1660+
elif command -v dnf; then
1661+
setup_rpm_exceptions
1662+
elif command -v microdnf; then
1663+
setup_rpm_exceptions
1664+
elif command -v yum; then
1665+
setup_rpm_exceptions
1666+
fi
1667+
16651668
# Check if dependencies are met for the script to run.
16661669
if [ "${upgrade}" -ne 0 ] ||
16671670
[ "${missing_packages}" -ne 0 ] ||

0 commit comments

Comments
 (0)