Compare commits

...

No commits in common. "c8" and "c10s" have entirely different histories.
c8 ... c10s

21 changed files with 184 additions and 268 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/ncompress-4.2.4.4.tar.gz
/ncompress-4.2.4.4.tar.gz
/v5.0.tar.gz

View File

@ -1 +0,0 @@
5f43cc6cfe5f70a8a58fdcf0fc40f4ab2168ee2f SOURCES/ncompress-4.2.4.4.tar.gz

View File

@ -1,13 +0,0 @@
diff --git a/compress42.c b/compress42.c
index 4d33342..495bdf3 100644
--- a/compress42.c
+++ b/compress42.c
@@ -1373,7 +1373,7 @@ compress(fdin, fdout)
REG11 int boff;
REG12 int n_bits;
REG13 int ratio;
- REG14 long checkpoint;
+ REG14 unsigned long long checkpoint;
REG15 code_int extcode;
union
{

View File

@ -1,11 +0,0 @@
--- ncompress-4.2.4/compress42.c.endians 2006-09-19 13:53:58.000000000 +0200
+++ ncompress-4.2.4/compress42.c 2006-09-19 13:57:54.000000000 +0200
@@ -432,7 +432,7 @@
union bytes
{
- long word;
+ int word;
struct
{
#if BYTEORDER == 4321

View File

@ -1,55 +0,0 @@
From 14d486afed1a1c5ef5ad14f92e52537e6aa68aad Mon Sep 17 00:00:00 2001
From: Ondrej Dubaj <odubaj@redhat.com>
Date: Wed, 6 May 2020 13:23:42 +0200
Subject: [PATCH] Do not set exit_code when an error is ignored
---
compress42.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/compress42.c b/compress42.c
index 834c2f2..3dd3d19 100644
--- a/compress42.c
+++ b/compress42.c
@@ -1193,7 +1193,6 @@ comprexx(fileptr)
{
fprintf(stderr, "\nunlink error (ignored) ");
perror(ofname);
- exit_code = 1;
}
remove_ofname = 0;
@@ -1241,7 +1240,6 @@ comprexx(fileptr)
{
fprintf(stderr, "\nutime error (ignored) ");
perror(ofname);
- exit_code = 1;
}
#ifndef AMIGA
@@ -1249,14 +1247,12 @@ comprexx(fileptr)
{
fprintf(stderr, "\nchmod error (ignored) ");
perror(ofname);
- exit_code = 1;
}
#ifndef DOS
if (chown(ofname, infstat.st_uid, infstat.st_gid)) /* Copy ownership */
{
fprintf(stderr, "\nchown error (ignored) ");
perror(ofname);
- exit_code = 1;
}
#endif
#endif
@@ -1266,7 +1262,6 @@ comprexx(fileptr)
{
fprintf(stderr, "\nunlink error (ignored) ");
perror(ifname);
- exit_code = 1;
}
}
}
--
2.24.1

View File

@ -1,60 +0,0 @@
diff --git a/compress42.c b/compress42.c
index b3b3add..6878046 100644
--- a/compress42.c
+++ b/compress42.c
@@ -141,6 +141,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#include <string.h>
#ifdef DIRENT
# include <dirent.h>
@@ -214,7 +215,7 @@
# define OBUFSIZ BUFSIZ /* Default output buffer size */
#endif
-#define MAXPATHLEN 1024 /* MAXPATHLEN - maximum length of a pathname we allow */
+#define MAXPATHLEN PATH_MAX /* MAXPATHLEN - maximum length of a pathname we allow */
#define SIZE_INNER_LOOP 256 /* Size of the inter (fast) compress loop */
/* Defines for third byte of header */
@@ -701,6 +702,7 @@ main(argc, argv)
{
REG3 char **filelist;
REG4 char **fileptr;
+ int i;
if (fgnd_flag = (signal(SIGINT, SIG_IGN) != SIG_IGN))
signal(SIGINT, (SIG_TYPE)abort_compress);
@@ -714,13 +716,18 @@ main(argc, argv)
nomagic = 1; /* Original didn't have a magic number */
#endif
- filelist = (char **)malloc(argc*sizeof(char *));
+ for (i=0; i<argc; i++) {
+ if (strlen(argv[i])>(MAXPATHLEN-1)) {
+ fprintf(stderr,"Filename too long\n");
+ exit(1);
+ }
+ }
+ filelist = fileptr = (char **)malloc(argc*sizeof(char *));
if (filelist == NULL)
{
fprintf(stderr, "Cannot allocate memory for file list.\n");
exit (1);
}
- fileptr = filelist;
*filelist = NULL;
if((progname = strrchr(argv[0], '/')) != 0)
@@ -860,7 +867,9 @@ nextarg: continue;
decompress(0, 1);
}
+ free(filelist);
exit((exit_code== -1) ? 1:exit_code);
+ return 0;
}
void

View File

@ -1,23 +0,0 @@
diff --git a/compress42.c b/compress42.c
index 804d099..b3b3add 100644
--- a/compress42.c
+++ b/compress42.c
@@ -130,6 +130,7 @@
* Add variable bit length output.
*
*/
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -538,8 +539,8 @@ int remove_ofname = 0; /* Remove output file on a error */
char ofname[MAXPATHLEN]; /* Output filename */
int fgnd_flag = 0; /* Running in background (SIGINT=SIGIGN) */
-long bytes_in; /* Total number of byte from input */
-long bytes_out; /* Total number of byte to output */
+long long bytes_in; /* Total number of byte from input */
+long long bytes_out; /* Total number of byte to output */
/*
* 8086 & 80286 Has a problem with array bigger than 64K so fake the array

View File

@ -1,20 +0,0 @@
diff --git a/Makefile.def b/Makefile.def
index e493d7c..1e6612f 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -31,7 +31,14 @@ MANDIR=/usr/local/man/man1
# -DDEF_ERRNO=1 Define error (not defined in errno.h).
# -DMAXSEG_64K=1 -BITS=16 Support segment processsor like 80286.
#
-options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3
+options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=20 \
+ -D_FILE_OFFSET_BITS=64 \
+ -D_LARGEFILE_SOURCE \
+ -DNOFUNCDEF=1 \
+ -DOBUFSIZ=1024 \
+ -DUTIME_H \
+ -DSYSDIR=1 \
+ $(ARCH_FLAGS)
# libary options
LBOPT= $(LDFLAGS)

View File

@ -1,12 +0,0 @@
diff -urNp ncompress-4.2.4-orig/compress42.c ncompress-4.2.4/compress42.c
--- ncompress-4.2.4-orig/compress42.c 2012-01-03 15:13:58.014222927 +0100
+++ ncompress-4.2.4/compress42.c 2012-01-03 15:15:17.117097419 +0100
@@ -1441,7 +1441,7 @@ compress(fdin, fdout)
boff = -(((OBUFSIZ<<3)-boff)%(n_bits<<3));
bytes_out += OBUFSIZ;
- memcpy(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1);
+ memmove(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1);
memset(outbuf+(outbits>>3)+1, '\0', OBUFSIZ);
}

View File

@ -1,33 +0,0 @@
diff --git a/compress42.c b/compress42.c
index c3f6b35..834c2f2 100644
--- a/compress42.c
+++ b/compress42.c
@@ -704,7 +704,7 @@ main(argc, argv)
REG4 char **fileptr;
int i;
- if (fgnd_flag = (signal(SIGINT, SIG_IGN) != SIG_IGN))
+ if ((fgnd_flag = (signal(SIGINT, SIG_IGN)) != SIG_IGN))
signal(SIGINT, (SIG_TYPE)abort_compress);
signal(SIGTERM, (SIG_TYPE)abort_compress);
@@ -1016,8 +1016,8 @@ comprexx(fileptr)
if (infstat.st_nlink > 1 && (!force))
{
- fprintf(stderr, "%s has %d other links: unchanged\n",
- tempname, infstat.st_nlink - 1);
+ fprintf(stderr, "%s has %ld other links: unchanged\n",
+ tempname, (long)(infstat.st_nlink - 1));
exit_code = 1;
return;
}
@@ -1318,7 +1318,7 @@ compdir(dir)
** think it's worth it. -- Dave Mack
*/
- while (dp = readdir(dirp))
+ while ((dp = readdir(dirp)))
{
if (dp->d_ino == 0)
continue;

2
ci.fmf Normal file
View File

@ -0,0 +1,2 @@
# Docs: https://docs.fedoraproject.org/en-US/ci/tmt/#_multiple_plans
resultsdb-testcase: separate

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/all-buildroot-internal.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/all-no-buildroot-internal.functional}

12
ncompress-5.0-2GB.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ur v5.0_original/ncompress-5.0/compress.c v5.0/ncompress-5.0/compress.c
--- v5.0_original/ncompress-5.0/compress.c 2021-02-02 09:16:16.000000000 +0100
+++ v5.0/ncompress-5.0/compress.c 2022-06-24 11:20:37.795568007 +0200
@@ -1236,7 +1236,7 @@
int boff;
int n_bits;
int ratio;
- long checkpoint;
+ unsigned long long checkpoint;
code_int extcode;
union
{

View File

@ -0,0 +1,12 @@
diff -ur v5.0_original/ncompress-5.0/compress.c v5.0/ncompress-5.0/compress.c
--- v5.0_original/ncompress-5.0/compress.c 2021-02-02 09:16:16.000000000 +0100
+++ v5.0/ncompress-5.0/compress.c 2022-06-24 11:39:42.325726170 +0200
@@ -357,7 +357,7 @@
union bytes
{
- long word;
+ int word;
struct
{
#if BYTEORDER == 4321

22
ncompress-5.0-lfs.patch Normal file
View File

@ -0,0 +1,22 @@
diff -ur v5.0_original/ncompress-5.0/compress.c v5.0/ncompress-5.0/compress.c
--- v5.0_original/ncompress-5.0/compress.c 2021-02-02 09:16:16.000000000 +0100
+++ v5.0/ncompress-5.0/compress.c 2022-06-24 11:11:52.435388146 +0200
@@ -150,6 +150,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#include <unistd.h>
#if !defined(DOS) && !defined(WINDOWS)
# include <dirent.h>
@@ -424,8 +425,8 @@
char *ofname = NULL; /* Output filename */
int fgnd_flag = 0; /* Running in background (SIGINT=SIGIGN) */
-long bytes_in; /* Total number of byte from input */
-long bytes_out; /* Total number of byte to output */
+long long bytes_in; /* Total number of byte from input */
+long long bytes_out; /* Total number of byte to output */
/*
* 8086 & 80286 Has a problem with array bigger than 64K so fake the array

19
ncompress-5.0-make.patch Normal file
View File

@ -0,0 +1,19 @@
diff -ur v5.0_original/ncompress-5.0/Makefile.def v5.0/ncompress-5.0/Makefile.def
--- v5.0_original/ncompress-5.0/Makefile.def 2021-02-02 09:16:16.000000000 +0100
+++ v5.0/ncompress-5.0/Makefile.def 2022-06-24 10:23:42.777040729 +0200
@@ -27,7 +27,14 @@
# -DBYTEORDER=<order> Byte order (default: unknown).
# -DMAXSEG_64K=1 -BITS=16 Support segment processor like 80286.
#
-options= $(CFLAGS) $(CPPFLAGS) -DUSERMEM=800000
+options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=20 \
+ -D_FILE_OFFSET_BITS=64 \
+ -D_LARGEFILE_SOURCE \
+ -DNOFUNCDEF=1 \
+ -DOBUFSIZ=1024 \
+ -DUTIME_H \
+ -DSYSDIR=1 \
+ $(ARCH_FLAGS)
# library options
LBOPT= $(LDFLAGS)

View File

@ -0,0 +1,11 @@
--- v5.0_original/ncompress-5.0/compress.c 2021-02-02 09:16:16.000000000 +0100
+++ v5.0/ncompress-5.0/compress.c 2022-06-24 11:41:59.632028398 +0200
@@ -1337,7 +1337,7 @@
boff = -(((OBUFSIZ<<3)-boff)%(n_bits<<3));
bytes_out += OBUFSIZ;
- memcpy(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1);
+ memmove(outbuf, outbuf+OBUFSIZ, (outbits>>3)+1);
memset(outbuf+(outbits>>3)+1, '\0', OBUFSIZ);
}

View File

@ -1,48 +1,46 @@
Summary: Fast compression and decompression utilities
Name: ncompress
Version: 4.2.4.4
Release: 13%{?dist}
License: Public Domain
Group: Applications/File
URL: http://ncompress.sourceforge.net/
Source: http://prdownloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
Version: 5.0
Release: 8%{?dist}
License: Unlicense
URL: https://github.com/vapier/%{name}
Source: https://github.com/vapier/%{name}/archive/refs/tags/v%{version}.tar.gz
# allow to build ncompress
# ~> downstream
Patch0: ncompress-4.2.4.4-make.patch
Patch0: ncompress-5.0-make.patch
# from dist-git commit 0539779d937
# (praiskup: removed redundant part as -DNOFUNCDEF is defined)
# ~> downstream
Patch1: ncompress-4.2.4.4-lfs.patch
Patch1: ncompress-5.0-lfs.patch
# exit when too long filename is given (do not segfault)
# ~> #unknown
# ~> downstream
Patch2: ncompress-4.2.4.4-filenamelen.patch
# Patch2: ncompress-4.2.4.4-filenamelen.patch
# Did not segfault, Prints error 'File name too long'
# permit files > 2GB to be compressed
# ~> #126775
Patch3: ncompress-4.2.4.4-2GB.patch
Patch3: ncompress-5.0-2GB.patch
# do not fail to compress on ppc/s390x
# ~> #207001
Patch4: ncompress-4.2.4.4-endians.patch
Patch4: ncompress-5.0-endians.patch
# use memmove instead of memcpy
# ~> 760657
# ~> downstream
Patch5: ncompress-4.2.4.4-memmove.patch
Patch5: ncompress-5.0-memmove.patch
# silence gcc warnings
# ~> downstream
Patch6: ncompress-4.2.4.4-silence-gcc.patch
# do not set exit_code when an error is ignored
# ~> #1830869
# ~> upstream (pkubat)
Patch7: ncompress-4.2.4.4-exit-code-ignored.patch
# Patch6: ncompress-4.2.4.4-silence-gcc.patch
# Fixed with %ld and brackets are included
BuildRequires: make
BuildRequires: gcc
BuildRequires: glibc-devel
%description
@ -55,13 +53,8 @@ compressed files.
Install ncompress if you need compression/decompression utilities
which are compatible with the original UNIX compress utility.
%prep
%setup -q
# configure build system
# ~> downstream
%patch0 -p1 -b .configure-buildsystem
%ifarch sparc m68k armv4l ppc s390 s390x ppc64 sparc64
ARCH_FLAGS="$ARCH_FLAGS -DBYTEORDER=1234"
%endif
@ -70,19 +63,12 @@ ARCH_FLAGS="$ARCH_FLAGS -DBYTEORDER=1234"
ARCH_FLAGS="$ARCH_FLAGS -DNOALLIGN=0"
%endif
sed "s/\$(ARCH_FLAGS)/$ARCH_FLAGS/" Makefile.def > Makefile
%patch1 -p1 -b .lfs
%patch2 -p1 -b .filenamelen
%patch3 -p1 -b .2GB
%patch4 -p1 -b .endians
%patch5 -p1 -b .memmove
%patch6 -p1 -b .silence-gcc
%patch7 -p1 -b .exit-code-ignored
%autosetup -n %{name}-%{version} -p2
%build
make CFLAGS="%{optflags} %{?nc_endian} %{?nc_align} %{build_ldflags}"
%install
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
@ -91,15 +77,74 @@ ln -sf compress $RPM_BUILD_ROOT/%{_bindir}/uncompress
install -p -m644 compress.1 $RPM_BUILD_ROOT%{_mandir}/man1
ln -sf compress.1 $RPM_BUILD_ROOT%{_mandir}/man1/uncompress.1
%check
./tests/runtests.sh
%files
%{_bindir}/compress
%{_bindir}/uncompress
%{_mandir}/man1/*
%doc LZW.INFO README
%doc LZW.INFO README.md
%changelog
* Wed May 06 2020 Ondrej Dubaj <odubaj@redhat.com> - 4.2.4.4-13
- Fixed exit code return when error is ignored (#1830869)
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 5.0-8
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 5.0-7
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jun 24 2022 Ondrej Sloup <osloup@redhat.com> - 5.0-1
- Use autosetup
- Change source links
- Redo patch files and remove obsolete ones
- Add runtests.sh
- Rebase to the latest upstream version (rhbz#1924029)
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 20 2018 Pavel Raiskup <praiskup@redhat.com> - 4.2.4.4-14
- fix FTBFS (missing gcc), rhbz#1604928
- cleanup rpmlint issues
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 4.2.4.4-12
- Use LDFLAGS from redhat-rpm-config
@ -207,7 +252,7 @@ ln -sf compress.1 $RPM_BUILD_ROOT%{_mandir}/man1/uncompress.1
* Fri Mar 18 2005 Peter Vrabec <pvrabec@redhat.com>
- rebuilt
* Thu Feb 08 2005 Peter Vrabec <pvrabec@redhat.com>
* Thu Feb 10 2005 Peter Vrabec <pvrabec@redhat.com>
- rebuilt
* Tue Oct 05 2004 Than Ngo <than@redhat.com> 4.2.4-40
@ -279,7 +324,7 @@ ln -sf compress.1 $RPM_BUILD_ROOT%{_mandir}/man1/uncompress.1
- update URL
- use %%{_mandir}
* Wed May 5 2000 Bill Nottingham <notting@redhat.com>
* Fri May 5 2000 Bill Nottingham <notting@redhat.com>
- fix "build" for ia64
* Mon Feb 7 2000 Bill Nottingham <notting@redhat.com>
@ -298,7 +343,7 @@ ln -sf compress.1 $RPM_BUILD_ROOT%{_mandir}/man1/uncompress.1
* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr
* Wed Oct 21 1997 Cristian Gafton <gafton@redhat.com>
* Wed Oct 22 1997 Cristian Gafton <gafton@redhat.com>
- fixed the spec file
* Mon Jun 02 1997 Erik Troan <ewt@redhat.com>

11
plans.fmf Normal file
View File

@ -0,0 +1,11 @@
/all-buildroot-internal:
plan:
import:
url: https://pkgs.devel.redhat.com/git/tests/ncompress
name: /plans/all-buildroot
/all-no-buildroot-internal:
plan:
import:
url: https://pkgs.devel.redhat.com/git/tests/ncompress
name: /plans/all-no-buildroot

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (v5.0.tar.gz) = 5bc886f98f25b03d034e8d8ebb0ee9388d727ee3e0c6d8a906698b2f8fa5c930f55d857486244b7f40447c7b74f3c620626600db619d0c6d6fd434f52912be42