[devtools] makerepropkg: correctly reproduce a pkgfile with any compression type

Message ID 20191227170830.1154340-1-eschwartz@archlinux.org
State Superseded, archived
Headers show
Series [devtools] makerepropkg: correctly reproduce a pkgfile with any compression type | expand

Commit Message

Emil Velikov via arch-projects Dec. 27, 2019, 5:08 p.m. UTC
We don't want the default PKGEXT in the current version of devtools, we
want the PKGEXT we *know* the input file used.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 makerepropkg.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/makerepropkg.in b/makerepropkg.in
index 51c2dd2..0721f65 100755
--- a/makerepropkg.in
+++ b/makerepropkg.in
@@ -144,6 +144,9 @@  export SOURCE_DATE_EPOCH="${buildinfo[builddate]}"
 PACKAGER="${buildinfo[packager]}"
 BUILDDIR="${buildinfo[builddir]}"
 
+trimprefix=${pkgfile%.pkg.tar*}
+PKGEXT=${pkgfile#$trimprefix}
+
 # nuke and restore reproducible testenv
 for copy in "${buildroot}"/*/; do
     [[ -d ${copy} ]] || continue
@@ -166,7 +169,7 @@  makechrootpkg -r "${buildroot}" -l "${chroot}" -- --packagelist || exit 1
 
 # set detected makepkg.conf options
 {
-    for var in PACKAGER BUILDDIR; do
+    for var in PACKAGER BUILDDIR PKGEXT; do
         printf '%s=%s\n' "${var}" "${!var@Q}"
     done
     printf 'OPTIONS=(%s)\n' "${buildopts[*]@Q}"