diff --git a/build-aux/edit-script.sh.in b/build-aux/edit-script.sh.in index 85c56cfe..992033b2 100644 --- a/build-aux/edit-script.sh.in +++ b/build-aux/edit-script.sh.in @@ -20,6 +20,7 @@ sed \ -e "s|@DEBUGSUFFIX[@]|@DEBUGSUFFIX@|g" \ -e "s|@INODECMD[@]|@INODECMD@|g" \ -e "s|@FILECMD[@]|@FILECMD@|g" \ + -e "s|@BSDTAR_NO_READ_SPARSE[@]|@BSDTAR_NO_READ_SPARSE@|g" \ "$input" >"$output" if [[ $mode ]]; then diff --git a/meson.build b/meson.build index b7cca865..1519a2bb 100644 --- a/meson.build +++ b/meson.build @@ -91,6 +91,11 @@ endif libarchive = dependency('libarchive', version : '>=3.0.0', static : get_option('buildstatic')) +if libarchive.version().version_compare('>=3.6.0') + bsdtar_no_read_sparse = '--no-read-sparse' +else + bsdtar_no_read_sparse = '' +endif libcurl = dependency('libcurl', version : '>=7.55.0', @@ -274,6 +279,7 @@ substs.set('LIBMAKEPKGDIR', LIBMAKEPKGDIR) substs.set('STRIP_BINARIES', strip_binaries) substs.set('STRIP_SHARED', strip_shared) substs.set('STRIP_STATIC', strip_static) +substs.set('BSDTAR_NO_READ_SPARSE', bsdtar_no_read_sparse) subdir('lib/libalpm') subdir('src/common') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5aaabf63..69757d03 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -616,7 +616,7 @@ create_package() { msg2 "$(gettext "Compressing package...")" # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail - list_package_files | LANG=C bsdtar --no-fflags -cnf - --null --files-from - | + list_package_files | LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ -cnf - --null --files-from - | compress_as "$PKGEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail @@ -714,7 +714,7 @@ create_srcpackage() { # TODO: Maybe this can be set globally for robustness shopt -s -o pipefail - LANG=C bsdtar --no-fflags -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? + LANG=C bsdtar --no-fflags @BSDTAR_NO_READ_SPARSE@ -cLf - ${pkgbase} | compress_as "$SRCEXT" > "${pkg_file}" || ret=$? shopt -u -o pipefail