summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2024-11-13 04:51:47 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-18 22:09:02 +0000
commit8d6a4559194795ab4f840a7f44981388dee84455 (patch)
tree044a094e654bfd0d4aa88cfd4d399089c9045475
parent12abaeb0fe3e9339c1ebc81554bf8b192e1d90af (diff)
downloadpoky-8d6a4559194795ab4f840a7f44981388dee84455.tar.gz
bzip2: fix 'bzip2 --version > /tmp/aaa 2>&1' hang
According to [1] As of the current version 1.0.8, bzip2 --version will print version info but it will also continue compressing stdin: $ ./bzip2 --version bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019. Copyright (C) 1996-2019 by Julian Seward. This program is free software; [...] bzip2: I won't write compressed data to a terminal. bzip2: For help, type: `bzip2 --help'. Debian (and its downstreams like Ubuntu) will patch this out [2], making the < /dev/null unnecessary, port a part of debian patch to fix the issue [1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2 [2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/ (From OE-Core rev: ae4fe4263ba9d372f9b9e80df4ec4697b51c1f9b) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch62
-rw-r--r--meta/recipes-extended/bzip2/bzip2_1.0.8.bb1
2 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
new file mode 100644
index 0000000000..84206b2a4d
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2/0001-fix-bzip2-version-tmp-aaa-will-hang.patch
@@ -0,0 +1,62 @@
1From a9dd6acbaca836fc4e943e69a31b2e7acda32045 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 13 Nov 2024 19:49:23 +0800
4Subject: [PATCH] fix 'bzip2 --version > /tmp/aaa 2>&1' hang
5
6According to [1]
7
8As of the current version 1.0.8, bzip2 --version will print version
9info but it will also continue compressing stdin:
10
11 $ ./bzip2 --version
12 bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
13
14 Copyright (C) 1996-2019 by Julian Seward.
15
16 This program is free software; [...]
17
18 bzip2: I won't write compressed data to a terminal.
19 bzip2: For help, type: `bzip2 --help'.
20
21Debian (and its downstreams like Ubuntu) will patch this out [2],
22making the < /dev/null unnecessary:
23
24[1] https://stackoverflow.com/questions/59757176/why-using-dev-null-with-a-program-like-bzip2
25[2] https://sources.debian.org/src/bzip2/1.0.8-6/debian/patches/20-legacy.patch/
26
27Upstream-Status: Submitted [bzip2-devel@sourceware.org]
28
29Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
30---
31 bzip2.c | 8 +++++---
32 1 file changed, 5 insertions(+), 3 deletions(-)
33
34diff --git a/bzip2.c b/bzip2.c
35index d95d280..6ec9871 100644
36--- a/bzip2.c
37+++ b/bzip2.c
38@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *argv[] )
39 case '8': blockSize100k = 8; break;
40 case '9': blockSize100k = 9; break;
41 case 'V':
42- case 'L': license(); break;
43+ case 'L': license();
44+ exit ( 0 );
45+ break;
46 case 'v': verbosity++; break;
47 case 'h': usage ( progName );
48 exit ( 0 );
49@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *argv[] )
50 if (ISFLAG("--keep")) keepInputFiles = True; else
51 if (ISFLAG("--small")) smallMode = True; else
52 if (ISFLAG("--quiet")) noisy = False; else
53- if (ISFLAG("--version")) license(); else
54- if (ISFLAG("--license")) license(); else
55+ if (ISFLAG("--version")) { license(); exit ( 0 ); } else
56+ if (ISFLAG("--license")) { license(); exit ( 0 ); } else
57 if (ISFLAG("--exponential")) workFactor = 1; else
58 if (ISFLAG("--repetitive-best")) redundant(aa->name); else
59 if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
60--
612.34.1
62
diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
index 324276df70..1327c446b3 100644
--- a/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.8.bb
@@ -26,6 +26,7 @@ SRC_URI = "https://sourceware.org/pub/${BPN}/${BPN}-${PV}.tar.gz \
26 file://configure.ac;subdir=${BP} \ 26 file://configure.ac;subdir=${BP} \
27 file://Makefile.am;subdir=${BP} \ 27 file://Makefile.am;subdir=${BP} \
28 file://run-ptest \ 28 file://run-ptest \
29 file://0001-fix-bzip2-version-tmp-aaa-will-hang.patch;subdir=${BP} \
29 " 30 "
30SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5" 31SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5"
31SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" 32SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"