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"
This commit is contained in:
Matthias Reichl 2018-03-01 12:04:12 +01:00 committed by MilhouseVH
parent 5d27b9f36e
commit 6d07b46e97

View File

@ -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