This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=57820551f682960232318aa272d40d2f601fd108

commit 57820551f682960232318aa272d40d2f601fd108
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Apr 19 03:31:33 2023 +0200

    test: Refactor deb-format package template generation into a new macro
    
    Once we split the test per compressor, we will need this same code,
    which we should not repeat.
---
 src/at/deb-format.at | 54 ++++++++++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/src/at/deb-format.at b/src/at/deb-format.at
index 56558ecea..53b27093b 100644
--- a/src/at/deb-format.at
+++ b/src/at/deb-format.at
@@ -164,6 +164,34 @@ dpkg-deb -c pkg-old-0933.deb
 
 AT_CLEANUP
 
+m4_define([DPKG_GEN_PKG_DEB_FORMAT_TEMPL], [
+  DPKG_GEN_CONTROL([pkg-deb-format])
+  DPKG_MOD_CONTROL([pkg-deb-format],
+                   [s/^Description:.*$/& - deb format support/])
+  AT_DATA([pkg-deb-format/file-templ], [test
+])
+  AT_CHECK([
+  # Initialize the template package
+  mv pkg-deb-format pkg-templ
+  cp $top_srcdir/ChangeLog.old pkg-templ/
+  chmod 0644 pkg-templ/ChangeLog.old
+  chmod -R u+w pkg-templ
+  find pkg-templ | xargs touch -t 197001010100.00
+  dpkg-deb --uniform-compression --root-owner-group -Znone -b pkg-templ 
>/dev/null
+
+  # Extract the base members
+  ar x pkg-templ.deb
+  gzip -c control.tar >control.tar.gz
+  gzip -c data.tar >data.tar.gz
+  xz -c control.tar >control.tar.xz
+  xz -c data.tar >data.tar.xz
+  zstd -c control.tar >control.tar.zst
+  zstd -c data.tar >data.tar.zst
+  bzip2 -c data.tar >data.tar.bz2
+  lzma -c data.tar >data.tar.lzma
+  ])
+])
+
 
 AT_SETUP([dpkg-deb .deb format 2.x])
 AT_KEYWORDS([dpkg-deb deb])
@@ -183,31 +211,7 @@ dpkg-deb --info pkg-deb-bogus-empty.deb
 
 AT_DATA([unknown], [])
 
-DPKG_GEN_CONTROL([pkg-deb-format])
-DPKG_MOD_CONTROL([pkg-deb-format],
-                 [s/^Description:.*$/& - deb format support/])
-AT_DATA([pkg-deb-format/file-templ], [test
-])
-AT_CHECK([
-# Initialize the template package
-mv pkg-deb-format pkg-templ
-cp $top_srcdir/ChangeLog.old pkg-templ/
-chmod 0644 pkg-templ/ChangeLog.old
-chmod -R u+w pkg-templ
-find pkg-templ | xargs touch -t 197001010100.00
-dpkg-deb --uniform-compression --root-owner-group -Znone -b pkg-templ 
>/dev/null
-
-# Extract the base members
-ar x pkg-templ.deb
-gzip -c control.tar >control.tar.gz
-gzip -c data.tar >data.tar.gz
-xz -c control.tar >control.tar.xz
-xz -c data.tar >data.tar.xz
-zstd -c control.tar >control.tar.zst
-zstd -c data.tar >data.tar.zst
-bzip2 -c data.tar >data.tar.bz2
-lzma -c data.tar >data.tar.lzma
-])
+DPKG_GEN_PKG_DEB_FORMAT_TEMPL()
 
 AT_CHECK([
 # Test debian-binary with 2.x versions

-- 
Dpkg.Org's dpkg

Reply via email to