From 6d07b46e97f548f0e75991a057c581b52cff0183 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Thu, 1 Mar 2018 12:04:12 +0100 Subject: [PATCH] scripts/extract: use tar to copy to correct directory also add support for custom tar opt, eg to exclude files or directories when copying This can be set eg with PKG_TAR_COPY_OPTS="--exclude=.git" --- scripts/extract | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/extract b/scripts/extract index e1a1f5138b..74a1bc4c6a 100755 --- a/scripts/extract +++ b/scripts/extract @@ -70,6 +70,9 @@ case $PKG_SOURCE_NAME in zcat $FULL_SOURCE_PATH | patch -d $2 -p1 ;; *) - cp -pPR $FULL_SOURCE_PATH $2 + FULL_DEST_PATH="$2/$PKG_NAME-$PKG_VERSION" + mkdir $FULL_DEST_PATH + tar cf - -C $FULL_SOURCE_PATH $PKG_TAR_COPY_OPTS . | \ + tar xf - -C $FULL_DEST_PATH ;; esac