From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Sascha Hauer Date: Wed, 26 Feb 2014 15:13:16 +0100 Message-Id: <1393424001-26060-2-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1393424001-26060-1-git-send-email-s.hauer@pengutronix.de> References: <1393424001-26060-1-git-send-email-s.hauer@pengutronix.de> Subject: [ptxdist] [PATCH 2/7] ptxdist: Add local-src command Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: mol@pengutronix.de, mkl@pengutronix.de Signed-off-by: Sascha Hauer --- bin/ptxdist | 8 ++++++++ scripts/lib/ptxd_lib_local_src.sh | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 scripts/lib/ptxd_lib_local_src.sh diff --git a/bin/ptxdist b/bin/ptxdist index b2c2e7a..0a86ad9 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -899,6 +899,8 @@ 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 + directory containing the sourcecode. bash enter a ptxdist environment bash shell bash [args...] execute in ptxdist environment export_src export all source archives needed for this @@ -1812,6 +1814,12 @@ EOF do echo $i done ) | sort ;; + local-src) + check_config || return + check_deps + ptxd_lib_local_src "${@}" + exit + ;; make) check_premake_compiler && ptxd_make_log "${@}" diff --git a/scripts/lib/ptxd_lib_local_src.sh b/scripts/lib/ptxd_lib_local_src.sh new file mode 100644 index 0000000..11decda --- /dev/null +++ b/scripts/lib/ptxd_lib_local_src.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright (C) 2014 Sascha Hauer +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# +ptxd_lib_local_src() { + if [ $# != 2 ]; then + echo "Usage: local_src " + exit 1 + fi + + pkgname="${1}" + target="${2}" + + mkdir -p ${PTXDIST_WORKSPACE}/local_src + + link="${PTXDIST_WORKSPACE}/local_src/${pkgname}${PTXDIST_PLATFORMSUFFIX}"; + + if [ -e ${link} ]; then + if [ -n "${PTX_FORCE}" ]; then + rm "${link}" || exit 1 + else + echo "${link} already exists. Use -f to overwrite" + exit 1 + fi + fi + + if [ ! -d "${target}" ]; then + echo "${target} does not exist or is not a directory" + exit 1 + fi + + echo "Creating local_src link for $pkgname. Package $pkgname will be built from ${target}" + + ln -s "${target}" "${link}" +} +export -f ptxd_lib_local_src -- 1.8.5.3 -- ptxdist mailing list ptxdist@pengutronix.de