summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-03-06 09:11:40 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-03-06 09:19:09 +0100
commite6127b5f38a96d1c0f7601f8b597fbd713f45696 (patch)
tree5a9abbe4ad06f2bbc0b7de75062c43f6586abfea /scripts
parent3a4e47d41c7db9b6ab047889acfb3869e91e9d1c (diff)
downloadptxdist-e6127b5f38a96d1c0f7601f8b597fbd713f45696.tar.gz
ptxdist-e6127b5f38a96d1c0f7601f8b597fbd713f45696.tar.xz
local-src: allow to remove the link
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_lib_local_src.sh13
1 files changed, 9 insertions, 4 deletions
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 <package> <directory>"
+ if [ $# -ne 1 -a $# -gt 2 ]; then
+ echo "Usage: local_src <package> [<directory>]"
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