diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-05-26 11:45:14 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-05-26 11:45:18 +0200 |
commit | df08227a444169efb695f5ca7a1956e37eb3e488 (patch) | |
tree | e114a5a0f608e9d0f453cd71247970f278721862 /scripts/libptxdist.sh | |
parent | e388ef7d42d4f91b4eed88305ea00c6005ae90a5 (diff) | |
download | ptxdist-df08227a444169efb695f5ca7a1956e37eb3e488.tar.gz ptxdist-df08227a444169efb695f5ca7a1956e37eb3e488.tar.xz |
ptxd_kconfig: avoid duplicate work
This is called 4 times before 'make' is executed. No need to do this
multiple times.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/libptxdist.sh')
-rw-r--r-- | scripts/libptxdist.sh | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 6f66be65c..66f1b8b7c 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -250,24 +250,28 @@ ptxd_kconfig() { ;; esac - local tmpdir - tmpdir="$(mktemp -d "${PTXDIST_TEMPDIR}/kconfig.XXXXXX")" || ptxd_bailout "unable to create tmpdir" - pushd "${tmpdir}" > /dev/null - - ln -sf "${PTXDIST_TOPDIR}/rules" && - mkdir config && - ptxd_in_path PTXDIST_PATH config && - for dir in "${ptxd_reply[@]}"; do - local tmp - for tmp in $(( cd "${dir}" && ls ) 2>/dev/null); do - if [ ! -e "config/${tmp}" ]; then - ln -sfT "${dir}/${tmp}" "config/${tmp}" || break - fi - done - done && - ln -sf "${PTXDIST_TOPDIR}/platforms" && - ln -sf "${PTXDIST_WORKSPACE}" workspace && - ln -sf "${PTX_KGEN_DIR}/generated" || return + local confdir="${PTXDIST_TEMPDIR}/kconfig" + if [ ! -d "${confdir}" ]; then + mkdir -p "${confdir}" || ptxd_bailout "unable to create tmpdir" + pushd "${confdir}" > /dev/null + + ln -sf "${PTXDIST_TOPDIR}/rules" && + mkdir config && + ptxd_in_path PTXDIST_PATH config && + for dir in "${ptxd_reply[@]}"; do + local tmp + for tmp in $( ( cd "${dir}" && ls ) 2>/dev/null); do + if [ ! -e "config/${tmp}" ]; then + ln -sfT "${dir}/${tmp}" "config/${tmp}" || break + fi + done + done && + ln -sf "${PTXDIST_TOPDIR}/platforms" && + ln -sf "${PTXDIST_WORKSPACE}" workspace && + ln -sf "${PTX_KGEN_DIR}/generated" + else + pushd "${confdir}" > /dev/null + fi && if [ -e "${file_dotconfig}" ]; then cp -- "${file_dotconfig}" ".config" || return @@ -309,7 +313,7 @@ ptxd_kconfig() { copy_back="false" KCONFIG_ALLCONFIG=".config" "${conf}" \ --writedepend --alldefconfig "${file_kconfig}" && - cp -- ".config" "${PTXDIST_DGEN_DIR}/${part}config" + mv -- ".config" "${PTXDIST_DGEN_DIR}/${part}config" ;; *) echo @@ -333,7 +337,6 @@ ptxd_kconfig() { fi popd > /dev/null - rm -fr "${tmpdir}" return $retval } |