Add support for ELIXIR_HIDDEN, a regular expression that matches

applications in Elixir's lib and hides them from the actual code
path.

It will be used by ports to hide their own (already installed) files
in lib/ during the builds, and avoid unnecessary warnings.
This commit is contained in:
Jimmy Olgeni 2015-07-01 15:50:11 +00:00
parent ece696bef0
commit beaf5ddfc8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=391075
2 changed files with 21 additions and 0 deletions

View file

@ -4,6 +4,7 @@
PORTNAME= elixir
PORTVERSION= 1.0.5
DISTVERSIONPREFIX= v
PORTREVISION= 1
CATEGORIES= lang
MAINTAINER= olgeni@FreeBSD.org

View file

@ -0,0 +1,20 @@
--- bin/elixir.orig 2015-06-29 07:56:28 UTC
+++ bin/elixir
@@ -97,4 +97,16 @@ if [ -z "$ERL_PATH" ]; then
fi
fi
-exec "$ERL_PATH" -pa "$SCRIPT_PATH"/../lib/*/ebin $ELIXIR_ERL_OPTIONS $ERL -extra "$@"
+if [ -n "$ELIXIR_HIDDEN" ]; then
+ CODE_PATH=""
+
+ for lib in $(cd "$SCRIPT_PATH"/../lib/ && ls); do
+ if ! (echo "$lib" | grep -E "$ELIXIR_HIDDEN" >/dev/null 2>&1); then
+ CODE_PATH="$CODE_PATH "$SCRIPT_PATH"/../lib/$lib/ebin"
+ fi
+ done
+
+ exec "$ERL_PATH" -pa $CODE_PATH $ELIXIR_ERL_OPTIONS $ERL -extra "$@"
+else
+ exec "$ERL_PATH" -pa "$SCRIPT_PATH"/../lib/*/ebin $ELIXIR_ERL_OPTIONS $ERL -extra "$@"
+fi