aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0011-testsuite-fix-cpio-tests.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-07-06 15:39:38 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-07-06 17:01:04 +0200
commit90b8dec39f98e83648301f1ad5dcd06597afb3ac (patch)
tree1c251ef1b2e7200e6199acc31006fcc37b6ae16b /main/busybox/0011-testsuite-fix-cpio-tests.patch
parent8d37b00520d39566c515e8040616ac1ad9614bf7 (diff)
downloadaports-90b8dec39f98e83648301f1ad5dcd06597afb3ac.tar.gz
aports-90b8dec39f98e83648301f1ad5dcd06597afb3ac.tar.bz2
aports-90b8dec39f98e83648301f1ad5dcd06597afb3ac.tar.xz
main/busybox: 1.27.0
Diffstat (limited to 'main/busybox/0011-testsuite-fix-cpio-tests.patch')
-rw-r--r--main/busybox/0011-testsuite-fix-cpio-tests.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/main/busybox/0011-testsuite-fix-cpio-tests.patch b/main/busybox/0011-testsuite-fix-cpio-tests.patch
new file mode 100644
index 0000000000..a6eb803de5
--- /dev/null
+++ b/main/busybox/0011-testsuite-fix-cpio-tests.patch
@@ -0,0 +1,82 @@
+From 9a522cf388e321b47f9462bbbd7726323095f8db Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Jul 2017 13:41:32 +0200
+Subject: [PATCH 11/11] testsuite: fix cpio tests
+
+The cpio tests don't search for the right output line correctly,
+using a hardcoded tail offset. Instead, grep for the file entry
+just added.
+
+The reverse-hunk patch tests seem to get the output order wrong,
+and the tests pass when this is corrected.
+---
+ testsuite/cpio.tests | 6 +++---
+ testsuite/patch.tests | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/testsuite/cpio.tests b/testsuite/cpio.tests
+index 88ec086b6..40f72c363 100755
+--- a/testsuite/cpio.tests
++++ b/testsuite/cpio.tests
+@@ -129,7 +129,7 @@ SKIP=
+
+ optional FEATURE_CPIO_O
+ testing "cpio uses by default uid/gid" \
+-"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ $user/$group
+ 0
+@@ -138,7 +138,7 @@ SKIP=
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with create" \
+-"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc -R 1234:5678 | cpio -tv 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 1234/5678
+ 0
+@@ -147,7 +147,7 @@ SKIP=
+
+ optional FEATURE_CPIO_O
+ testing "cpio -R with extract" \
+-"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | tail -n +2 | awk ' { print \$2 } '; echo \$?" \
++"echo $0 | cpio -o -H newc | cpio -tv -R 8765:4321 2>&1 | grep -F $(basename $0) | awk ' { print \$2 } '; echo \$?" \
+ "\
+ 8765/4321
+ 0
+diff --git a/testsuite/patch.tests b/testsuite/patch.tests
+index 39205242c..1d48e90be 100755
+--- a/testsuite/patch.tests
++++ b/testsuite/patch.tests
+@@ -75,12 +75,12 @@ zxc
+ testing "patch detects already applied hunk" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ +def
+ 123
+-patching file input
+ 1
+ abc
+ def
+@@ -103,12 +103,12 @@ def
+ testing "patch detects already applied hunk at the EOF" \
+ 'patch 2>&1; echo $?; cat input' \
+ "\
++patching file input
+ Possibly reversed hunk 1 at 4
+ Hunk 1 FAILED 1/1.
+ abc
+ 123
+ +456
+-patching file input
+ 1
+ abc
+ 123
+--
+2.13.2
+