diff options
author | Dario Lombardo <lomato@gmail.com> | 2018-04-24 12:26:47 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2018-04-24 20:28:34 +0000 |
commit | 0202bc995b8966399f3d3ba29f82579b1500e594 (patch) | |
tree | 0ff263b0db920a1348323500ca241b72e57c1c57 | |
parent | 167a6e03b26a972093204f73ad6df3e6261bbdcc (diff) |
tools: make rpm and debian setup scripts more similar.
Change-Id: Ie46d56aff91694a3b8c4c62b4b03e38d3fb1e68a
Reviewed-on: https://code.wireshark.org/review/27116
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rwxr-xr-x | tools/debian-setup.sh | 2 | ||||
-rwxr-xr-x | tools/rpm_setup.sh | 27 |
2 files changed, 25 insertions, 4 deletions
diff --git a/tools/debian-setup.sh b/tools/debian-setup.sh index c4f19ed316..2e2bc253f3 100755 --- a/tools/debian-setup.sh +++ b/tools/debian-setup.sh @@ -28,7 +28,7 @@ then exit 1 fi -for op in $@ +for op do if [ "$op" = "--install-optional" ] then diff --git a/tools/rpm_setup.sh b/tools/rpm_setup.sh index c7e408a099..f857fd2d24 100755 --- a/tools/rpm_setup.sh +++ b/tools/rpm_setup.sh @@ -11,6 +11,23 @@ # that way. # +if [ "$1" = "--help" ] +then + echo "\nUtility to setup a rpm-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 the packet manager\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 do if [ "$op" = "--install-optional" ] @@ -124,12 +141,16 @@ echo "perl-Pod-Html is unavailable" >&2 add_package ADDITIONAL_LIST asciidoctor || add_package ADDITIONAL_LIST rubygem-asciidoctor.noarch || echo "asciidoctor is unavailable" >&2 -$PM install $BASIC_LIST +# Now arrange for optional support libraries +if [ $ADDITIONAL ] +then + ACTUAL_LIST="$ACTUAL_LIST $ADDITIONAL_LIST" +fi + +$PM install $ACTUAL_LIST $OPTIONS # Now arrange for optional support libraries if [ ! $ADDITIONAL ] then echo -e "\n*** Optional packages not installed. Rerun with --install-optional to have them.\n" -else - $PM install $ADDITIONAL_LIST $OPTIONS fi |