From eda7e07f74cd8f152a78f9f46629e2ee84f5f916 Mon Sep 17 00:00:00 2001 From: awlane Date: Sun, 27 Oct 2024 15:52:35 -0500 Subject: [PATCH] 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 --- docs/install.rst | 1 + install.sh | 12 +++++++----- util/pkgdep/common.sh | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) 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 @@ Some notable flags are: - ``--ppa`` prefers installing NDN software from `named-data 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 `, 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 @@ fi 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 @@ while true; do --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 @@ Misc options: --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 @@ DEP_WAFOPTS=( # 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]}"