Compare commits

..

1 commit

Author SHA1 Message Date
Jakub Martisko
e4b3ae6e39 Fix: wrong skip value in gzexe; enable make check
Related: 1690825
2019-03-27 10:14:38 +01:00
11 changed files with 135 additions and 134 deletions

View file

@ -1 +0,0 @@
1

5
.gitignore vendored
View file

@ -4,8 +4,3 @@ gzip-1.4.tar.xz
/gzip-1.7.tar.xz
/gzip-1.8.tar.xz
/gzip-1.9.tar.xz
/gzip-1.10.tar.xz
/gzip-1.11.tar.xz
/gzip-1.12.tar.xz
/gzip-1.13.tar.xz
/gzip-1.14.tar.xz

75
gzexe.patch Normal file
View file

@ -0,0 +1,75 @@
From 21cd963565a43dabd59516bd4cca5c76a614f255 Mon Sep 17 00:00:00 2001
From: Jakub Martisko <jamartis@redhat.com>
Date: Tue, 26 Mar 2019 12:29:30 +0100
Subject: [PATCH] Fix: the value of the skip variable in the gzexe
---
gzexe.in | 4 ++--
tests/Makefile.am | 1 +
tests/gzexe | 20 ++++++++++++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
create mode 100755 tests/gzexe
diff --git a/gzexe.in b/gzexe.in
index 6c61183..cffa84e 100644
--- a/gzexe.in
+++ b/gzexe.in
@@ -145,7 +145,7 @@ for i do
if test $decomp -eq 0; then
(cat <<'EOF' &&
#!/bin/sh
-skip=44
+skip=49
tab=' '
nl='
@@ -201,7 +201,7 @@ EOF
else
# decompression
- skip=44
+ skip=49
skip_line=`sed -e 1d -e 2q "$file"`
case $skip_line in
skip=[0-9] | skip=[0-9][0-9] | skip=[0-9][0-9][0-9])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ebdce5b..4dfbccf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
TESTS = \
+ gzexe \
gzip-env \
helin-segv \
help-version \
diff --git a/tests/gzexe b/tests/gzexe
new file mode 100755
index 0000000..45f71c7
--- /dev/null
+++ b/tests/gzexe
@@ -0,0 +1,20 @@
+#!/bin/sh
+#Try running simple shell script compressed by gzexe
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+cat <<EOF > foo || framework_failure_
+#!/bin/sh
+echo "Hello World!"
+EOF
+
+echo "Hello World!" > exp || framework_failure_
+
+fail=0
+gzexe foo || fail=1
+/bin/sh foo > out 2> err || fail=1
+
+compare exp out || fail=1
+test -s err && fail=1
+
+Exit $fail
--
2.21.0

108
gzip.spec
View file

@ -1,27 +1,27 @@
Summary: GNU data compression program
Summary: The GNU data compression program
Name: gzip
Version: 1.14
Release: 1%{?dist}
Version: 1.9
Release: 9%{?dist}
# info pages are under GFDL license
License: GPL-3.0-or-later AND GFDL-1.3-only
Source0: https://ftp.gnu.org/gnu/gzip/gzip-%{version}.tar.xz
License: GPLv3+ and GFDL
Source0: http://ftp.gnu.org/gnu/gzip/gzip-%{version}.tar.xz
Source1: https://www.gnu.org/licenses/fdl-1.3.txt
# downstream solution for coloured z*grep (#1034839)
Source100: colorzgrep.csh
Source101: colorzgrep.sh
Patch1: s390_errno.patch
Patch1: gnulib.patch
Patch2: gzexe.patch
# Fixed in upstream code.
# http://thread.gmane.org/gmane.comp.gnu.gzip.bugs/378
URL: https://www.gzip.org/
URL: http://www.gzip.org/
# Requires should not be added for gzip wrappers (eg. zdiff, zgrep,
# zless) of another tools, because gzip "extends" the tools by its
# wrappers much more than it "requires" them.
Requires: coreutils
BuildRequires: texinfo, gcc, autoconf, automake, less
BuildRequires: make
Conflicts: filesystem < 3
Provides: /bin/gunzip
Provides: /bin/gzip
@ -39,8 +39,8 @@ very commonly used data compression program.
%prep
%setup -q
%patch 1 -p1
%patch1 -p1 -b .gnulib
%patch2 -p1 -b .gzexe
cp %{SOURCE1} .
autoreconf
@ -50,23 +50,13 @@ export CPPFLAGS="-DHAVE_LSTAT"
export CC="%{__cc}"
export CPP="%{__cpp}"
export CXX="%{__cxx}"
%ifarch s390x
#When the otpimizations are enabled, the huft test fails as of F44/gzip1.14
#export CFLAGS="$RPM_OPT_FLAGS -Dalignas=_Alignas -DDFLTCC_LEVEL_MASK=0x7e"
#use this in the next realease after gzip 1.13 export CFLAGS="$RPM_OPT_FLAGS -DDFLTCC_LEVEL_MASK=0x7e"
#%configure --enable-dfltcc
%configure
%else
%configure
%endif
make
%check
make check
#make gzip.info
%install
rm -rf ${RPM_BUILD_ROOT}
%makeinstall
gzip -9nf ${RPM_BUILD_ROOT}%{_infodir}/gzip.info*
@ -74,7 +64,7 @@ gzip -9nf ${RPM_BUILD_ROOT}%{_infodir}/gzip.info*
# we don't ship it, so let's remove it from ${RPM_BUILD_ROOT}
rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
# uncompress is a part of ncompress package
rm -f ${RPM_BUILD_ROOT}%{_bindir}/uncompress
rm -f ${RPM_BUILD_ROOT}/%{_bindir}/uncompress
# coloured z*grep (#1034839)
%global profiledir %{_sysconfdir}/profile.d
@ -84,6 +74,7 @@ install -p -m 644 %{SOURCE101} %{buildroot}%{profiledir}
%files
%doc NEWS README AUTHORS ChangeLog THANKS TODO
%{!?_licensedir:%global license %%doc}
%license COPYING fdl-1.3.txt
%{_bindir}/*
%{_mandir}/*/*
@ -91,79 +82,6 @@ install -p -m 644 %{SOURCE101} %{buildroot}%{profiledir}
%{profiledir}/*
%changelog
* Thu Aug 14 2025 Jakub Martisko <jamartis@redhat.com> - 1.14-1
- Rebase to gzip 1.14
- There are some issues when the s390x optimizations are turned on - the hufts test fails
- This will need some further investigation, for the time, I've disabled the optimizations
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Feb 01 2024 Jakub Martisko <jamartis@redhat.com> - 1.13-1
- Rebase to gzip 1.13
- There's a bug on s390x: https://lists.gnu.org/archive/html/bug-gzip/2023-10/msg00000.html
- Revert the s390x build options in the next release
Resolves: rhbz#2232890
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Aug 02 2023 Jakub Martisko <jamartis@redhat.com> - 1.12-6
- Enbale the s390x optimizations
Resolves: rhbz#2175699
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Apr 13 2023 Lukáš Zaoral <lzaoral@redhat.com> - 1.12-4
- migrate to SPDX license format
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Apr 11 2022 Jakub Martisko <jamartis@redhat.com> - 1.12-1
- Rebase to gzip 1.12
Resolves: rhbz#2073133
Resolves: CVE-2022-1271
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Oct 21 2021 Jakub Martisko <jamartis@redhat.com> - 1.11-1
- Rebase to gzip 1.11
- Run the tests in the check section instead of the build section
Resolve: rhbz#2001025
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 09 2019 Jakub Martisko <jamartis@redhat.com> - 1.10-1
- Rebase to 1.10
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Mar 26 2019 Jakub Martisko <jamartis@redhat.com> - 1.9-9
- Fix wrong skip size in gzexe
- Add new test dealing with the ^^ (needs autoreconf)

View file

@ -1,6 +0,0 @@
summary: Basic smoke test
discover:
how: fmf
url: https://src.fedoraproject.org/tests/gzip.git
execute:
how: tmt

View file

@ -1,26 +0,0 @@
From c76affb4551630ff661ac1c1ee99353a17eb16e1 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 30 May 2025 12:31:04 -0700
Subject: gzip: fix s390x build failure
Problem reported by Jakub Martisko <https://bugs.gnu.org/78618>.
* dfltcc.c: Include errno.h.
---
dfltcc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dfltcc.c b/dfltcc.c
index 9f86581..8307a97 100644
--- a/dfltcc.c
+++ b/dfltcc.c
@@ -17,6 +17,7 @@
#include <config.h>
+#include <errno.h>
#include <stdlib.h>
#ifdef HAVE_SYS_SDT_H
--
cgit v1.2.3

View file

@ -1 +1 @@
SHA512 (gzip-1.14.tar.xz) = 82aef53188b3e69b51b7ddab5b8c44a11a5b73c0039b22a315a0c7d244694feab0146748add4265901eb1b4c0cee8a9eb69594995f098830d964091af97079c5
SHA512 (gzip-1.9.tar.xz) = c0852e7f7662141e79d14bc36e50f1940dba3e804feff3b0b8fa084ffec720ac245352282d2f1db117fadc95758424dd418d192b94621dac4367834ccf101fad

2
tests/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.swp
*.retry

11
tests/test-simple Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
set -ex
# exercise installed gzip/gunzip programs
echo "Bla" > bla.file
cp bla.file bla.file.orig
gzip bla.file
gunzip bla.file.gz
cmp bla.file bla.file.orig
echo "hi"
rm bla.file bla.file.orig

32
tests/test_simple.yml Normal file
View file

@ -0,0 +1,32 @@
---
- hosts: localhost
vars:
- artifacts: ./artifacts
tags:
- atomic
- classic
- container
remote_user: root
tasks:
- name: Create the folder where we will store the tests
action: file state=directory path={{ item }}
owner=root group=root
with_items:
- /usr/local/bin
- name: Install the test files
copy: src={{ item.file }} dest=/usr/local/bin/{{ item.dest }}
mode=0755
with_items:
- {file: test-simple, dest: test-simple }
- block:
- name: Execute the tests
shell: exec > /tmp/test.log && /usr/local/bin/test-simple 2>&1
- always:
- name: Pull out the logs
fetch:
dest: "{{ artifacts }}/"
src: "/tmp/test.log"
flat: yes

1
tests/tests.yml Normal file
View file

@ -0,0 +1 @@
- include: test_simple.yml