summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/gzip
diff options
context:
space:
mode:
authorDenys Zagorui <denys.zagorui@globallogic.com>2017-06-08 17:04:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-12 15:08:30 +0100
commit578d88d3ed7986bb5b0a16eaaf322d4c0c61621a (patch)
tree05583811ef1c27918c3747f7702b2bd9de16674e /meta/recipes-extended/gzip
parentdfefd671f35599deba668a2c29bbc6c02469b4da (diff)
downloadpoky-578d88d3ed7986bb5b0a16eaaf322d4c0c61621a.tar.gz
gzip: add ptest
(From OE-Core rev: 9f389cfc6023be50816491bbdd3e4266195573d3) Signed-off-by: Denys Zagorui <denys.zagorui@globallogic.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/gzip')
-rw-r--r--meta/recipes-extended/gzip/files/0001-gzip-port-zdiff-zless-to-Busybox.patch59
-rw-r--r--meta/recipes-extended/gzip/files/run-ptest6
-rw-r--r--meta/recipes-extended/gzip/gzip_1.8.bb20
3 files changed, 84 insertions, 1 deletions
diff --git a/meta/recipes-extended/gzip/files/0001-gzip-port-zdiff-zless-to-Busybox.patch b/meta/recipes-extended/gzip/files/0001-gzip-port-zdiff-zless-to-Busybox.patch
new file mode 100644
index 0000000000..20d5a19f76
--- /dev/null
+++ b/meta/recipes-extended/gzip/files/0001-gzip-port-zdiff-zless-to-Busybox.patch
@@ -0,0 +1,59 @@
1From 5f712621829ed81a758077431226a86df37fbc3b Mon Sep 17 00:00:00 2001
2From: Denys Zagorui <denys.zagorui@globallogic.com>
3Date: Thu, 8 Jun 2017 16:05:50 +0300
4Subject: [PATCH] gzip: port zdiff, zless to Busybox
5
6Problem reported by Denys Zagorui (Bug#26088).
7* tests/zdiff: Check that diff uses POSIX-format output.
8* zless.in (less_version): Don't exit merely because 'less -V'
9fails; instead, assume 'less' is compatible with an old version of
10the original 'less'. Busybox 'less -V' fails, but apparently its
11'less' works anyway somehow.
12
13Signed-off-by: Denys Zagorui <denys.zagorui@globallogic.com>
14
15Upstream-Status: Accepted
16---
17 tests/zdiff | 4 +++-
18 zless.in | 2 +-
19 2 files changed, 4 insertions(+), 2 deletions(-)
20
21diff --git a/tests/zdiff b/tests/zdiff
22index 0bb7c7d..9cd4fd4 100755
23--- a/tests/zdiff
24+++ b/tests/zdiff
25@@ -22,7 +22,6 @@
26
27 echo a > a || framework_failure_
28 echo b > b || framework_failure_
29-gzip a b || framework_failure_
30
31 cat <<EOF > exp
32 1c1
33@@ -31,7 +30,10 @@ cat <<EOF > exp
34 > b
35 EOF
36
37+diff a b | diff exp - || skip_ "diff output format is incompatible with POSIX"
38+
39 fail=0
40+gzip a b || fail=1
41 zdiff a.gz b.gz > out 2>&1
42 test $? = 1 || fail=1
43
44diff --git a/zless.in b/zless.in
45index e634af6..9759ae6 100644
46--- a/zless.in
47+++ b/zless.in
48@@ -47,7 +47,7 @@ if test "${LESSMETACHARS+set}" != set; then
49 export LESSMETACHARS
50 fi
51
52-less_version=`less -V` || exit
53+less_version=`less -V 2>/dev/null`
54 case $less_version in
55 less' '45[1-9]* | \
56 less' '4[6-9][0-9]* | \
57--
581.9.1
59
diff --git a/meta/recipes-extended/gzip/files/run-ptest b/meta/recipes-extended/gzip/files/run-ptest
new file mode 100644
index 0000000000..cf7c64949a
--- /dev/null
+++ b/meta/recipes-extended/gzip/files/run-ptest
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3cd src/tests
4
5make check
6
diff --git a/meta/recipes-extended/gzip/gzip_1.8.bb b/meta/recipes-extended/gzip/gzip_1.8.bb
index 11be846b21..a0dec143db 100644
--- a/meta/recipes-extended/gzip/gzip_1.8.bb
+++ b/meta/recipes-extended/gzip/gzip_1.8.bb
@@ -2,7 +2,9 @@ require gzip.inc
2 2
3LICENSE = "GPLv3+" 3LICENSE = "GPLv3+"
4 4
5SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz" 5SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \
6 file://0001-gzip-port-zdiff-zless-to-Busybox.patch \
7 file://run-ptest"
6SRC_URI_append_class-target = " file://wrong-path-fix.patch" 8SRC_URI_append_class-target = " file://wrong-path-fix.patch"
7 9
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ 10LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
@@ -12,6 +14,22 @@ PROVIDES_append_class-native = " gzip-replacement-native"
12 14
13BBCLASSEXTEND = "native" 15BBCLASSEXTEND = "native"
14 16
17inherit ptest
18
19do_install_ptest() {
20 mkdir -p ${D}${PTEST_PATH}/src/build-aux
21 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/
22 mkdir -p ${D}${PTEST_PATH}/src/tests
23 cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests
24 sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \
25 -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \
26 -e 's/^GREP = ..*/GREP = grep/' \
27 -e 's/^AWK = ..*/AWK = awk/' \
28 -e 's/^srcdir = ..*/srcdir = \./' \
29 -e 's/^Makefile: ..*/Makefile: /' \
30 ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile
31}
32
15SRC_URI[md5sum] = "732553152814b22dc35aa0267df5286c" 33SRC_URI[md5sum] = "732553152814b22dc35aa0267df5286c"
16SRC_URI[sha256sum] = "1ff7aedb3d66a0d73f442f6261e4b3860df6fd6c94025c2cb31a202c9c60fe0e" 34SRC_URI[sha256sum] = "1ff7aedb3d66a0d73f442f6261e4b3860df6fd6c94025c2cb31a202c9c60fe0e"
17 35