[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg 1.21.3 deb-split test failure on Alpine



Hello,

While upgrading the Alpine Linux dpkg package from 1.21.2 to 1.21.3, I
observed the following test failure of the "dpkg-split .deb format" test
case during `make check`:

	./at/testsuite: /home/soeren/src/aports/main/dpkg/src/dpkg-1.21.3/src/at/testsuite.dir/at-groups/7/test-source: line 94: DEB_SPLIT_PART_SIZE_VERSION: not found
	./deb-split.at:43:
	# Test debian-split with 2.x version
	cp pkg-split-part.1of10.deb pkg-split-part-version-2x.deb
	ar x pkg-split-part-version-2x.deb debian-split
	sed -e '1c2.999' debian-split >debian-split.new
	mv debian-split.new debian-split
	ar rc pkg-split-part-version-2x.deb debian-split
	ar t pkg-split-part-version-2x.deb
	dpkg-split -I pkg-split-part-version-2x.deb

	--- -
	+++ /home/soeren/src/aports/main/dpkg/src/dpkg-1.21.3/src/at/testsuite.dir/at-groups/7/stdout
	@@ -11,6 +11,6 @@
	     Part number:                    1/10
	     Part length:                    214016 bytes
	     Part offset:                    0 bytes
	-    Part file size (used portion):   bytes
	+    Part file size (used portion):  214224 bytes


	7. deb-split.at:9: 7. dpkg-split .deb format (deb-split.at:9): FAILED (deb-split.at:43

Further debugging revealed that the problem is the following line in
src/at/deb-split.at which was added in commit
1eb7343dd4c2dd527b181ad8841897003ad32752 as part of the 1.21.3 release:

	((DEB_SPLIT_PART_SIZE_MAGIC_EXTRA = DEB_SPLIT_PART_SIZE + 10))

This syntax seems to some sort of non-POSIX shell extension. Since this
line is copied as-is to the generated src/at/testsuite shell script, which
is executed with #!/bin/sh on Alpine, using non-POSIX shell syntax is a
bad idea. Attached is a git-format-patch(1) which fixes the issue.

Please CC me, I am not subscribed to the list.

Greetings,
Sören

>From 0519b2cd4a725c1d62d649d1c63d9a40158dd9fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sat, 26 Mar 2022 03:33:43 +0100
Subject: [PATCH] test: Don't use non-POSIX shell syntax for arithmetic
 expressions

Instead just invoke expr(1). This fixes a test failure on Alpine Linux
which uses Busybox ash to execute the generated test script.
Alternatively, it would also be possible to use arithmetic expansions.
---
 src/at/deb-split.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/at/deb-split.at b/src/at/deb-split.at
index 6378210c0..cd189abfa 100644
--- a/src/at/deb-split.at
+++ b/src/at/deb-split.at
@@ -38,7 +38,7 @@ DEB_SPLIT_PART_SIZE=214222
 DEB_SPLIT_LAST_LENGTH=183488
 DEB_SPLIT_LAST_SIZE=183694
 
-((DEB_SPLIT_PART_SIZE_VERSION = DEB_SPLIT_PART_SIZE + 2))
+DEB_SPLIT_PART_SIZE_VERSION=$(expr $DEB_SPLIT_PART_SIZE + 2)
 
 AT_CHECK_UNQUOTED([
 # Test debian-split with 2.x version
@@ -66,7 +66,7 @@ pkg-split-part-version-2x.deb:
 
 ])
 
-((DEB_SPLIT_PART_SIZE_MAGIC_EXTRA = DEB_SPLIT_PART_SIZE + 10))
+DEB_SPLIT_PART_SIZE_MAGIC_EXTRA=$(expr $DEB_SPLIT_PART_SIZE + 10)
 
 AT_CHECK_UNQUOTED([
 # Test debian-split with extra lines

Reply to: