diff mbox

[3/7] get-all: fail if optional repositories have been deconfigured

Message ID 20170525192549.138518-4-ebiggers3@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Biggers May 25, 2017, 7:25 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

If an optional repository is enabled and then later disabled, require
that the corresponding directory manually be removed; otherwise, it
would still be included in the build.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 get-all | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/get-all b/get-all
index a0f0d05..fa27229 100755
--- a/get-all
+++ b/get-all
@@ -81,6 +81,15 @@  setup_repo()
 	fi
     fi
 
+    if [ -z "$repo_url" ] && ! $required; then
+	cat 1>&2 <<EOF
+ERROR: $repo_url_variable has been removed from the config file,
+but the $repo_name directory still exists.  Remove it if you don't
+want it to be built.
+EOF
+	exit 1
+    fi
+
     # If a specific commit was specified, check it out.
     if [ -n "$commit" ]; then
 	( cd "$repo_name";