I'm working on a system configuration script for a Raspberry Pi 3 which installs a number of packages, including the xorg group. The script needs to be idempotent (running it multiple times yields the same result). However, I don't want to reinstall packages which are already present and up to date. For that purpose, I am using pacman's --needed flag. On regular Arch Linux the following command succeeds even if the xorg group has already been installed:
$this->bbcode_second_pass_code('', '
# sudo pacman -S --needed --noconfirm xorg
:: There are 50 members in group xorg:
:: Repository extra
1) xf86-video-vesa 2) xorg-bdftopcf 3) xorg-docs 4) xorg-font-util 5) xorg-fonts-100dpi 6) xorg-fonts-75dpi 7) xorg-fonts-encodings 8) xorg-iceauth 9) xorg-luit 10) xorg-mkfontscale 11) xorg-server 12) xorg-server-common 13) xorg-server-devel 14) xorg-server-xdmx 15) xorg-server-xephyr 16) xorg-server-xnest 17) xorg-server-xvfb 18) xorg-server-xwayland 19) xorg-sessreg 20) xorg-setxkbmap 21) xorg-smproxy 22) xorg-x11perf 23) xorg-xauth 24) xorg-xbacklight 25) xorg-xcmsdb 26) xorg-xcursorgen 27) xorg-xdpyinfo 28) xorg-xdriinfo 29) xorg-xev 30) xorg-xgamma 31) xorg-xhost 32) xorg-xinput 33) xorg-xkbcomp 34) xorg-xkbevd 35) xorg-xkbutils 36) xorg-xkill 37) xorg-xlsatoms 38) xorg-xlsclients 39) xorg-xmodmap 40) xorg-xpr 41) xorg-xprop 42) xorg-xrandr 43) xorg-xrdb 44) xorg-xrefresh 45) xorg-xset 46) xorg-xsetroot 47) xorg-xvinfo 48) xorg-xwd 49) xorg-xwininfo 50) xorg-xwud
Enter a selection (default=all): warning: xf86-video-vesa-2.4.0-2 is up to date -- skipping
warning: xorg-bdftopcf-1.1-1 is up to date -- skipping
warning: xorg-docs-1.7.1-2 is up to date -- skipping
warning: xorg-font-util-1.3.2-1 is up to date -- skipping
warning: xorg-fonts-100dpi-1.0.3-4 is up to date -- skipping
warning: xorg-fonts-75dpi-1.0.3-4 is up to date -- skipping
warning: xorg-fonts-encodings-1.0.5-1 is up to date -- skipping
warning: xorg-iceauth-1.0.8-1 is up to date -- skipping
warning: xorg-luit-1.1.1-3 is up to date -- skipping
warning: xorg-mkfontscale-1.2.1-1 is up to date -- skipping
warning: xorg-server-1.20.5-2 is up to date -- skipping
warning: xorg-server-common-1.20.5-2 is up to date -- skipping
warning: xorg-server-devel-1.20.5-2 is up to date -- skipping
warning: xorg-server-xdmx-1.20.5-2 is up to date -- skipping
warning: xorg-server-xephyr-1.20.5-2 is up to date -- skipping
warning: xorg-server-xnest-1.20.5-2 is up to date -- skipping
warning: xorg-server-xvfb-1.20.5-2 is up to date -- skipping
warning: xorg-server-xwayland-1.20.5-2 is up to date -- skipping
warning: xorg-sessreg-1.1.2-1 is up to date -- skipping
warning: xorg-setxkbmap-1.3.2-1 is up to date -- skipping
warning: xorg-smproxy-1.0.6-2 is up to date -- skipping
warning: xorg-x11perf-1.6.1-1 is up to date -- skipping
warning: xorg-xauth-1.1-1 is up to date -- skipping
warning: xorg-xbacklight-1.2.3-1 is up to date -- skipping
warning: xorg-xcmsdb-1.0.5-2 is up to date -- skipping
warning: xorg-xcursorgen-1.0.7-1 is up to date -- skipping
warning: xorg-xdpyinfo-1.3.2-2 is up to date -- skipping
warning: xorg-xdriinfo-1.0.6-1 is up to date -- skipping
warning: xorg-xev-1.2.3-1 is up to date -- skipping
warning: xorg-xgamma-1.0.6-2 is up to date -- skipping
warning: xorg-xhost-1.0.8-1 is up to date -- skipping
warning: xorg-xinput-1.6.3-1 is up to date -- skipping
warning: xorg-xkbcomp-1.4.2+7+g29fda8e-1 is up to date -- skipping
warning: xorg-xkbevd-1.1.4-2 is up to date -- skipping
warning: xorg-xkbutils-1.0.4-3 is up to date -- skipping
warning: xorg-xkill-1.0.5-1 is up to date -- skipping
warning: xorg-xlsatoms-1.1.3-1 is up to date -- skipping
warning: xorg-xlsclients-1.1.4-1 is up to date -- skipping
warning: xorg-xmodmap-1.0.10-1 is up to date -- skipping
warning: xorg-xpr-1.0.5-1 is up to date -- skipping
warning: xorg-xprop-1.2.4-1 is up to date -- skipping
warning: xorg-xrandr-1.5.1-1 is up to date -- skipping
warning: xorg-xrdb-1.2.0-1 is up to date -- skipping
warning: xorg-xrefresh-1.0.6-1 is up to date -- skipping
warning: xorg-xset-1.2.4-1 is up to date -- skipping
warning: xorg-xsetroot-1.1.2-1 is up to date -- skipping
warning: xorg-xvinfo-1.1.4-1 is up to date -- skipping
warning: xorg-xwd-1.0.7-1 is up to date -- skipping
warning: xorg-xwininfo-1.1.5-1 is up to date -- skipping
warning: xorg-xwud-1.0.5-1 is up to date -- skipping
there is nothing to do
')
On Arch Linux Arm, it fails due to a conflict between xorg-mkfontdir and xorg-mkfontscale.
$this->bbcode_second_pass_code('', '
# pacman -S --needed --noconfirm xorg
:: There are 51 members in group xorg:
:: Repository extra
1) xf86-video-vesa 2) xorg-bdftopcf 3) xorg-docs 4) xorg-font-util 5) xorg-fonts-100dpi 6) xorg-fonts-75dpi
7) xorg-fonts-encodings 8) xorg-iceauth 9) xorg-luit 10) xorg-mkfontdir 11) xorg-mkfontscale 12) xorg-server
13) xorg-server-common 14) xorg-server-devel 15) xorg-server-xdmx 16) xorg-server-xephyr 17) xorg-server-xnest
18) xorg-server-xvfb 19) xorg-server-xwayland 20) xorg-sessreg 21) xorg-setxkbmap 22) xorg-smproxy 23) xorg-x11perf
24) xorg-xauth 25) xorg-xbacklight 26) xorg-xcmsdb 27) xorg-xcursorgen 28) xorg-xdpyinfo 29) xorg-xdriinfo 30) xorg-xev
31) xorg-xgamma 32) xorg-xhost 33) xorg-xinput 34) xorg-xkbcomp 35) xorg-xkbevd 36) xorg-xkbutils 37) xorg-xkill
38) xorg-xlsatoms 39) xorg-xlsclients 40) xorg-xmodmap 41) xorg-xpr 42) xorg-xprop 43) xorg-xrandr 44) xorg-xrdb
45) xorg-xrefresh 46) xorg-xset 47) xorg-xsetroot 48) xorg-xvinfo 49) xorg-xwd 50) xorg-xwininfo 51) xorg-xwud
Enter a selection (default=all):
warning: xf86-video-vesa-2.4.0-2 is up to date -- skipping
warning: xorg-bdftopcf-1.1-1 is up to date -- skipping
warning: xorg-docs-1.7.1-2 is up to date -- skipping
warning: xorg-font-util-1.3.2-1 is up to date -- skipping
warning: xorg-fonts-100dpi-1.0.3-4 is up to date -- skipping
warning: xorg-fonts-75dpi-1.0.3-4 is up to date -- skipping
warning: xorg-fonts-encodings-1.0.5-1 is up to date -- skipping
warning: xorg-iceauth-1.0.8-1 is up to date -- skipping
warning: xorg-luit-1.1.1-3 is up to date -- skipping
warning: xorg-mkfontscale-1.2.1-1 is up to date -- skipping
warning: xorg-server-1.20.5-2 is up to date -- skipping
warning: xorg-server-common-1.20.5-2 is up to date -- skipping
warning: xorg-server-devel-1.20.5-2 is up to date -- skipping
warning: xorg-server-xdmx-1.20.5-2 is up to date -- skipping
warning: xorg-server-xephyr-1.20.5-2 is up to date -- skipping
warning: xorg-server-xnest-1.20.5-2 is up to date -- skipping
warning: xorg-server-xvfb-1.20.5-2 is up to date -- skipping
warning: xorg-server-xwayland-1.20.5-2 is up to date -- skipping
warning: xorg-sessreg-1.1.2-1 is up to date -- skipping
warning: xorg-setxkbmap-1.3.2-1 is up to date -- skipping
warning: xorg-smproxy-1.0.6-2 is up to date -- skipping
warning: xorg-x11perf-1.6.1-1 is up to date -- skipping
warning: xorg-xauth-1.1-1 is up to date -- skipping
warning: xorg-xbacklight-1.2.3-1 is up to date -- skipping
warning: xorg-xcmsdb-1.0.5-2 is up to date -- skipping
warning: xorg-xcursorgen-1.0.7-1 is up to date -- skipping
warning: xorg-xdpyinfo-1.3.2-2 is up to date -- skipping
warning: xorg-xdriinfo-1.0.6-1 is up to date -- skipping
warning: xorg-xev-1.2.3-1 is up to date -- skipping
warning: xorg-xgamma-1.0.6-2 is up to date -- skipping
warning: xorg-xhost-1.0.8-1 is up to date -- skipping
warning: xorg-xinput-1.6.3-1 is up to date -- skipping
warning: xorg-xkbcomp-1.4.2+7+g29fda8e-1 is up to date -- skipping
warning: xorg-xkbevd-1.1.4-2 is up to date -- skipping
warning: xorg-xkbutils-1.0.4-3 is up to date -- skipping
warning: xorg-xkill-1.0.5-1 is up to date -- skipping
warning: xorg-xlsatoms-1.1.3-1 is up to date -- skipping
warning: xorg-xlsclients-1.1.4-1 is up to date -- skipping
warning: xorg-xmodmap-1.0.10-1 is up to date -- skipping
warning: xorg-xpr-1.0.5-1 is up to date -- skipping
warning: xorg-xprop-1.2.4-1 is up to date -- skipping
warning: xorg-xrandr-1.5.1-1 is up to date -- skipping
warning: xorg-xrdb-1.2.0-1 is up to date -- skipping
warning: xorg-xrefresh-1.0.6-1 is up to date -- skipping
warning: xorg-xset-1.2.4-1 is up to date -- skipping
warning: xorg-xsetroot-1.1.2-1 is up to date -- skipping
warning: xorg-xvinfo-1.1.4-1 is up to date -- skipping
warning: xorg-xwd-1.0.7-1 is up to date -- skipping
warning: xorg-xwininfo-1.1.5-1 is up to date -- skipping
warning: xorg-xwud-1.0.5-1 is up to date -- skipping
resolving dependencies...
looking for conflicting packages...
:: xorg-mkfontdir and xorg-mkfontscale are in conflict. Remove xorg-mkfontscale? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: xorg-mkfontdir and xorg-mkfontscale are in conflict
')
It should be noted that the command still fails without --noconfirm whether or not you choose to remove xorg-mkfontscale. I believe the cause of this issue is that the xorg group on Arch Linux Arm contains both xorg-mkfontdir and xorg-mkfontscale wheras Arch Linux only has the latter.
Arch Linux Arm
$this->bbcode_second_pass_code('', '
# pacman -Sg xorg | grep mkfont
xorg xorg-mkfontdir
xorg xorg-mkfontscale
')
Arch Linux
$this->bbcode_second_pass_code('', '
# pacman -Sg xorg | grep mkfont
xorg xorg-mkfontscale
')