From ae1e9c79d1f4ab1b02fcb21259a4114c311000bc Mon Sep 17 00:00:00 2001 From: zhoupengcheng Date: Fri, 19 Apr 2024 17:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbunzip2=20-L/-V=E5=92=8Cbzcat?= =?UTF-8?q?=20-L/-V=E6=9F=A5=E8=AF=A2=E4=BF=A1=E6=81=AF=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=B8=94=E8=BF=94=E5=9B=9E=E5=80=BC=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit de601d9f5ea29e3a252508b41e7f9753c499f3e2) --- ...utput-to-stdout-and-exit-with-code-0.patch | 48 +++++++++++++++++++ bzip2.spec | 6 ++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch diff --git a/0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch b/0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch new file mode 100644 index 0000000..af5bcbf --- /dev/null +++ b/0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch @@ -0,0 +1,48 @@ +From 65179284ceddc43e6388bf4ed8c2d85cf16e1b2f Mon Sep 17 00:00:00 2001 +From: Rikard Gynnerstedt +Date: Thu, 24 Oct 2019 12:48:57 +0200 +Subject: [PATCH] license and version print should output to stdout and exit + with code 0 +Reference: https://gitlab.com/bzip2/bzip2/-/commit/65179284ceddc43e6388bf4ed8c2d85cf16e1b2f +Conflict: NA +--- + bzip2.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/bzip2.c b/bzip2.c +index ed1a33f..6da2905 100644 +--- a/bzip2.c ++++ b/bzip2.c +@@ -1600,7 +1600,7 @@ void testf ( Char *name ) + static + void license ( void ) + { +- fprintf ( stderr, ++ fprintf ( stdout, + + "bzip2, a block-sorting file compressor. " + "Version %s.\n" +@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *argv[] ) + case '8': blockSize100k = 8; break; + case '9': blockSize100k = 9; break; + case 'V': +- case 'L': license(); break; ++ case 'L': license(); ++ exit ( 0 ); ++ break; + case 'v': verbosity++; break; + case 'h': usage ( progName ); + exit ( 0 ); +@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *argv[] ) + if (ISFLAG("--keep")) keepInputFiles = True; else + if (ISFLAG("--small")) smallMode = True; else + if (ISFLAG("--quiet")) noisy = False; else +- if (ISFLAG("--version")) license(); else +- if (ISFLAG("--license")) license(); else ++ if (ISFLAG("--version")) { license(); exit ( 0 ); } else ++ if (ISFLAG("--license")) { license(); exit ( 0 ); } else + if (ISFLAG("--exponential")) workFactor = 1; else + if (ISFLAG("--repetitive-best")) redundant(aa->name); else + if (ISFLAG("--repetitive-fast")) redundant(aa->name); else +-- +GitLab diff --git a/bzip2.spec b/bzip2.spec index 7199f3d..adc699d 100644 --- a/bzip2.spec +++ b/bzip2.spec @@ -1,6 +1,6 @@ Name: bzip2 Version: 1.0.8 -Release: 6 +Release: 7 Summary: A high-quality data compressor License: BSD @@ -10,6 +10,7 @@ Source1: bzip2.pc Patch0: 0001-add-compile-option.patch Patch1: 0002-CVE-2019-12900.patch +Patch2: 0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch BuildRequires: gcc @@ -99,6 +100,9 @@ make check %{_mandir}/man1/b*.1.gz %changelog +* Fri Apr 19 2024 zhoupengcheng - 1.0.8-7 +- license and version print should output to stdout and exit with code + * Thu Apr 13 2023 Chenxi Mao - 1.0.8-6 - Support build with clang. -- Gitee