From fd78fb5ed34a2f77439936f2480a0284f56d559e Mon Sep 17 00:00:00 2001 From: Nextraztus Date: Fri, 7 Aug 2015 08:22:18 -0600 Subject: [PATCH] replace vcs_relative_path with non-python, fixes #115 --- bin/_blackbox_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index 556024f..b18c5e5 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -329,7 +329,11 @@ function enumerate_blackbox_repos() { function vcs_relative_path() { # Usage: vcs_relative_path file local name="$1" - python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))' + #python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))' + local p=$( echo -n "$( pwd -P )/${1}" | sed 's#//*#/#g' ) + local name="${p#$REPOBASE}" + name=$( echo -n "$name" | sed 's#^/##g' | sed 's#/$##g' ) + echo -n $name } # Removes a line from a text file