diff --git a/build-package.sh b/build-package.sh index 695bbd6637..59a775e9f4 100755 --- a/build-package.sh +++ b/build-package.sh @@ -113,21 +113,7 @@ termux_step_post_massage() { } # Create data.tar.gz with files to package. Not to be overridden by package scripts. -termux_step_create_datatar() { - # Create data tarball containing files to package: - cd "$TERMUX_PKG_MASSAGEDIR" - - local HARDLINKS - HARDLINKS="$(find . -type f -links +1)" - if [ -n "$HARDLINKS" ]; then - termux_error_exit "Package contains hard links: $HARDLINKS" - fi - - if [ -z "${TERMUX_PKG_METAPACKAGE+x}" ] && [ "$(find . -type f)" = "" ]; then - termux_error_exit "No files in package" - fi - tar -cJf "$TERMUX_PKG_PACKAGEDIR/data.tar.xz" . -} +source scripts/build/termux_step_create_datatar.sh termux_step_create_debscripts() { return diff --git a/scripts/build/termux_step_create_datatar.sh b/scripts/build/termux_step_create_datatar.sh new file mode 100644 index 0000000000..756cb6e6a4 --- /dev/null +++ b/scripts/build/termux_step_create_datatar.sh @@ -0,0 +1,15 @@ +termux_step_create_datatar() { + # Create data tarball containing files to package: + cd "$TERMUX_PKG_MASSAGEDIR" + + local HARDLINKS + HARDLINKS="$(find . -type f -links +1)" + if [ -n "$HARDLINKS" ]; then + termux_error_exit "Package contains hard links: $HARDLINKS" + fi + + if [ -z "${TERMUX_PKG_METAPACKAGE+x}" ] && [ "$(find . -type f)" = "" ]; then + termux_error_exit "No files in package" + fi + tar -cJf "$TERMUX_PKG_PACKAGEDIR/data.tar.xz" . +}