This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit c723283340bd371db8375fff64f754d91cf56cfc Author: chao.an <anc...@xiaomi.com> AuthorDate: Wed Jul 1 17:04:53 2020 +0800 make/import: support import zip use relative path mkimport.sh failure if using relative path: $ ./tools/mkimport.sh -x ../incubator-nuttx/nuttx-export-9.1.0.zip unzip: cannot find or open ../incubator-nuttx/nuttx-export-9.1.0.zip, ../incubator-nuttx/nuttx-export-9.1.0.zip.zip or ../incubator-nuttx/nuttx-export-9.1.0.zip.ZIP. ERROR: unzip ../incubator-nuttx/nuttx-export-9.1.0.zip failed Change-Id: Ifc93c5e4dac95ec79a4e909b22ef646fbfe4484d Signed-off-by: chao.an <anc...@xiaomi.com> --- tools/mkimport.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/mkimport.sh b/tools/mkimport.sh index 1c7a7a6..7ce1948 100755 --- a/tools/mkimport.sh +++ b/tools/mkimport.sh @@ -114,19 +114,19 @@ rm -rf ${DALLDIRS} mkdir ${TMPDIR} || \ { echo "ERROR: Failed to create ${TMPDIR}"; exit 1; } -# Unpack the export package into the temporary directory - -cd ${TMPDIR} || \ - { echo "ERROR: Failed to cd to ${TMPDIR}"; exit 1; } - if [ "X${TGZ}" == "Xy" ]; then - tar zxf ${EXPORT} || \ + tar zxf ${EXPORT} -C ${TMPDIR} || \ { echo "ERROR: tar zxf ${EXPORT} failed"; exit 1; } else - unzip ${EXPORT} || \ + unzip ${EXPORT} -d ${TMPDIR} || \ { echo "ERROR: unzip ${EXPORT} failed"; exit 1; } fi +# Unpack the export package into the temporary directory + +cd ${TMPDIR} || \ + { echo "ERROR: Failed to cd to ${TMPDIR}"; exit 1; } + EXPORTDIR=`ls` if [ -z "${EXPORTDIR}" ]; then