summaryrefslogtreecommitdiffstats
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
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>
-rwxr-xr-xbin/ptxdist3
-rw-r--r--scripts/lib/ptxd_lib_local_src.sh13
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 <var> 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 <pkg> <directory> overwrite a package source with a locally provided
+ local-src <pkg> [<directory>] 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 <cmd> [args...] execute <cmd> in ptxdist environment
export_src <target dir> 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 <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