No longer use existing installs by default and change commands accordingly
Changes ignore-existing flag to use-existing and inverts default behavior.
Also adds this to docs.
Refs #5336
Change-Id: I1f3f68160673321e92307c9aacc7ff361b1d1a48
diff --git a/docs/install.rst b/docs/install.rst
index 3e5040c..d9511de 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -47,6 +47,7 @@
- ``--ppa`` prefers installing NDN software from `named-data PPA <https://launchpad.net/~named-data/+archive/ubuntu/ppa>`_.
This shortens installation time by downloading binary packages, but is only available on Ubuntu.
- ``--source`` prefers installing NDN software from source code.
+- ``--use-existing`` will only install dependencies not already in the executable path.
IMPORTANT: For now, Mininet-WiFi only works with ``--source`` installation because the current NFD release (0.7.1) doesn't
incorporate `issue 5155 <https://redmine.named-data.net/issues/5155>`, a required patch for WiFi module to work properly.
diff --git a/install.sh b/install.sh
index 8d4ef9a..7b7b640 100755
--- a/install.sh
+++ b/install.sh
@@ -72,7 +72,7 @@
PREFER_FROM=ppa
PPA_PKGS=()
-ARGS=$(getopt -o 'hy' -l 'help,dir:,jobs:,no-wifi,ppa,source,release:,cxx:,dummy-keychain,nfd:,psync:,nlsr:,tools:,traffic:,infoedit:,mininet:,mnwifi:,dl-only,ignore-existing' -- "$@")
+ARGS=$(getopt -o 'hy' -l 'help,dir:,jobs:,no-wifi,ppa,source,release:,cxx:,dummy-keychain,nfd:,psync:,nlsr:,tools:,traffic:,infoedit:,mininet:,mnwifi:,dl-only,use-existing' -- "$@")
eval set -- "$ARGS"
while true; do
case $1 in
@@ -95,7 +95,7 @@
--mininet) MININET_VERSION=$2; shift 2;;
--mnwifi) MNWIFI_VERSION=$2; shift 2;;
--dl-only) DL_ONLY=1; shift;;
- --ignore-existing) IGNORE_EXISTING=1; shift;;
+ --use-existing) USE_EXISTING=1; shift;;
--) shift; break;;
*) exit 1;;
esac
@@ -166,9 +166,11 @@
--dl-only
Download the source code only.
You may modify the code in ${CODEROOT} and then rerun this script to install them.
- --ignore-existing
- Ignore already installed binaries and libraries, and attempt to reinstall.
- This is useful if you have modified source code checkout and want to install again.
+ --use-existing
+ Use already installed dependency binaries and libraries, rather than attempting to
+ reinstall. This is useful if you have modified source code checkout for some
+ repositories but still want to install any remaining dependencies or are
+ reinstalling Mini-NDN.
EOT
exit 0
fi
diff --git a/util/pkgdep/common.sh b/util/pkgdep/common.sh
index 60749ef..62ab1ee 100644
--- a/util/pkgdep/common.sh
+++ b/util/pkgdep/common.sh
@@ -127,7 +127,7 @@
# return whether dep is installed
dep_exists() {
- if [[ $IGNORE_EXISTING -eq 1 ]]; then
+ if [[ $USE_EXISTING -eq 0 ]]; then
return 2
fi
local DETECT="${DEP_DETECT[$1]}"