2 # Setup development environment on Arch Linux
4 # Wireshark - Network traffic analyzer
5 # By Gerald Combs <gerald@wireshark.org>
6 # Copyright 1998 Gerald Combs
8 # SPDX-License-Identifier: GPL-2.0-or-later
10 # We drag in tools that might not be needed by all users; it's easier
16 function print_usage
() {
17 printf "\\nUtility to setup a pacman-based system for Wireshark development.\\n"
18 printf "The basic usage installs the needed software\\n\\n"
19 printf "Usage: %s [--install-optional] [...other options...]\\n" "$0"
20 printf "\\t--install-optional: install optional software as well\\n"
21 printf "\\t--install-test-deps: install packages required to run all tests\\n"
22 printf "\\t--install-all: install everything\\n"
23 printf "\\t[other]: other options are passed as-is to pacman\\n"
24 printf "\\tPass --noconfirm to bypass any \"are you sure?\" messages.\\n"
49 OPTIONS
="$OPTIONS $arg"
54 # Check if the user is root
55 if [ "$(id -u)" -ne 0 ]
57 echo "You must be root."
61 BASIC_LIST
="base-devel
97 ADDITIONAL_LIST
="asciidoctor
105 TESTDEPS_LIST
="python-pytest
108 ACTUAL_LIST
=$BASIC_LIST
110 if [ $ADDITIONAL -ne 0 ]
112 ACTUAL_LIST
="$ACTUAL_LIST $ADDITIONAL_LIST"
115 if [ $TESTDEPS -ne 0 ]
117 ACTUAL_LIST
="$ACTUAL_LIST $TESTDEPS_LIST"
120 # Partial upgrades are unsupported.
121 # shellcheck disable=SC2086
122 pacman
--sync --refresh --sysupgrade --needed $ACTUAL_LIST $OPTIONS ||
exit 2
124 if [ $ADDITIONAL -eq 0 ]
126 printf "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
129 if [ $TESTDEPS -eq 0 ]
131 printf "\n*** Test deps not installed. Rerun with --install-test-deps to have them.\n"
136 printf "\n*** These and other packages may also be found in the AUR: libsmi.\n"