forked from osmocom/wireshark
tools: improve debian-setup.
Change-Id: If547e0e1c821d3696eba0f303e8ab0769b1fabb4 Reviewed-on: https://code.wireshark.org/review/21245 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
This commit is contained in:
parent
451731f0c6
commit
5b1a802c3e
|
@ -23,6 +23,23 @@
|
||||||
# that way.
|
# that way.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if [ "$1" = "--help" ]
|
||||||
|
then
|
||||||
|
echo "\nUtility to setup a debian-based system for Wireshark Development.\n"
|
||||||
|
echo "The basic usage installs the needed software\n\n"
|
||||||
|
echo "Usage: $0 [--install-optional] [...other options...]\n"
|
||||||
|
echo "\t--install-optional: install optional software as well"
|
||||||
|
echo "\t[other]: other options are passed as-is to apt\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if the user is root
|
||||||
|
if [ $(id -u) -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "You must be root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
for op in $@
|
for op in $@
|
||||||
do
|
do
|
||||||
if [ "$op" = "--install-optional" ]
|
if [ "$op" = "--install-optional" ]
|
||||||
|
@ -74,13 +91,21 @@ add_package ADDITIONAL_LIST libgnutls28-dev ||
|
||||||
add_package ADDITIONAL_LIST libgnutls-dev ||
|
add_package ADDITIONAL_LIST libgnutls-dev ||
|
||||||
echo "libgnutls28-dev and libgnutls-dev are unavailable" >&2
|
echo "libgnutls28-dev and libgnutls-dev are unavailable" >&2
|
||||||
|
|
||||||
# Install basic packages
|
ACTUAL_LIST=$BASIC_LIST
|
||||||
apt-get install $BASIC_LIST $OPTIONS
|
|
||||||
|
|
||||||
# Now arrange for optional support libraries
|
# Now arrange for optional support libraries
|
||||||
|
if [ $ADDITIONAL ]
|
||||||
|
then
|
||||||
|
ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST"
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt-get install $ACTUAL_LIST $OPTIONS
|
||||||
|
if [ $? != 0 ]
|
||||||
|
then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! $ADDITIONAL ]
|
if [ ! $ADDITIONAL ]
|
||||||
then
|
then
|
||||||
echo "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
|
echo "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n"
|
||||||
else
|
|
||||||
apt-get install $ADDITIONAL_LIST $OPTIONS
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue