From e6127b5f38a96d1c0f7601f8b597fbd713f45696 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 6 Mar 2014 09:11:40 +0100 Subject: local-src: allow to remove the link Signed-off-by: Michael Olbrich --- bin/ptxdist | 3 ++- scripts/lib/ptxd_lib_local_src.sh | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/ptxdist b/bin/ptxdist index 14e94456e..10577c5a9 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -907,8 +907,9 @@ Misc: print print the contents of a variable, in the way it is known by "make" list-packages print a list of all selected packages - local-src overwrite a package source with a locally provided + local-src [] overwrite a package source with a locally provided directory containing the sourcecode. + Not specifying a the directory will undo the change. bash enter a ptxdist environment bash shell bash [args...] execute in ptxdist environment export_src export all source archives needed for this diff --git a/scripts/lib/ptxd_lib_local_src.sh b/scripts/lib/ptxd_lib_local_src.sh index e44d8ec10..c844e13ca 100644 --- a/scripts/lib/ptxd_lib_local_src.sh +++ b/scripts/lib/ptxd_lib_local_src.sh @@ -8,17 +8,22 @@ # see the README file. # ptxd_lib_local_src() { - if [ $# != 2 ]; then - echo "Usage: local_src " + if [ $# -ne 1 -a $# -gt 2 ]; then + echo "Usage: local_src []" exit 1 fi local pkgname="${1}" local target="${2}" + local link="${PTXDIST_WORKSPACE}/local_src/${pkgname}${PTXDIST_PLATFORMSUFFIX}"; - mkdir -p "${PTXDIST_WORKSPACE}/local_src" + if [ -z "${target}" ]; then + echo "Removing local_src link for '${pkgname}'." + rm -f "${link}" + return + fi - local link="${PTXDIST_WORKSPACE}/local_src/${pkgname}${PTXDIST_PLATFORMSUFFIX}" + mkdir -p "${PTXDIST_WORKSPACE}/local_src" if [ -e "${link}" -o -L "${link}" ]; then if [ -n "${PTX_FORCE}" ]; then -- cgit v1.2.3