SHA256
3
0
forked from pool/zstd

Accepting request 644196 from home:AndreasStieger:branches:Archiving

zstd 1.3.7

OBS-URL: https://build.opensuse.org/request/show/644196
OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=24
This commit is contained in:
Bernhard M. Wiedemann 2018-10-24 09:34:08 +00:00 committed by Git OBS Bridge
parent 92aa6cbd1c
commit 3c35264bb6
5 changed files with 28 additions and 127 deletions

View File

@ -1,103 +0,0 @@
From 712a9fd9721c314f4b0238577d803b012845f6d2 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Fri, 29 Jun 2018 15:33:44 -0400
Subject: [PATCH 1/2] Allow Invoking `zstd --list` When `stdin` is not a `tty`
Also now returns an error when no inputs are given.
New proposed behavior:
```
felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l; echo $?
No files given
1
felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Makefile.zst; echo $?
Frames Skips Compressed Uncompressed Ratio Check Filename
1 0 3.08 KB 10.92 KB 3.544 XXH64 Makefile.zst
0
felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l <Makefile.zst; echo $?
zstd: --list does not support reading from standard input
No files given
1
felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Makefile.zst <Makefile.zst; echo $?
Frames Skips Compressed Uncompressed Ratio Check Filename
1 0 3.08 KB 10.92 KB 3.544 XXH64 Makefile.zst
0
felix@odin:~/prog/zstd (list-stdin-check)$
```
---
programs/fileio.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/programs/fileio.c b/programs/fileio.c
index 0175b316..b4eed28d 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -2017,21 +2017,25 @@ static int FIO_listFile(fileInfo_t* total, const char* inFileName, int displayLe
}
int FIO_listMultipleFiles(unsigned numFiles, const char** filenameTable, int displayLevel){
-
- if (!IS_CONSOLE(stdin)) {
- DISPLAYOUT("zstd: --list does not support reading from standard input\n");
- return 1;
+ unsigned u;
+ for (u=0; u<numFiles;u++) {
+ if (!strcmp (filenameTable[u], stdinmark)) {
+ DISPLAYOUT("zstd: --list does not support reading from standard input\n");
+ return 1;
+ }
}
if (numFiles == 0) {
+ if (!IS_CONSOLE(stdin)) {
+ DISPLAYOUT("zstd: --list does not support reading from standard input\n");
+ }
DISPLAYOUT("No files given\n");
- return 0;
+ return 1;
}
if (displayLevel <= 2) {
DISPLAYOUT("Frames Skips Compressed Uncompressed Ratio Check Filename\n");
}
{ int error = 0;
- unsigned u;
fileInfo_t total;
memset(&total, 0, sizeof(total));
total.usesCheck = 1;
--
2.16.4
From 8e7bdc18d62632adcee029b2f8f5013d11549dd7 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Fri, 29 Jun 2018 16:31:22 -0400
Subject: [PATCH 2/2] Fix Tests of `--list` Behavior with `stdin`
---
tests/playTests.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/playTests.sh b/tests/playTests.sh
index 09a7377f..aa5535d5 100755
--- a/tests/playTests.sh
+++ b/tests/playTests.sh
@@ -731,8 +731,14 @@ $ECHO "\n===> zstd --list/-l error detection tests "
! $ZSTD -lv tmp1*
! $ZSTD --list -v tmp2 tmp12.zst
-$ECHO "\n===> zstd --list/-l exits 1 when stdin is piped in"
-! echo "piped STDIN" | $ZSTD --list
+$ECHO "\n===> zstd --list/-l errors when presented with stdin / no files"
+! $ZSTD -l
+! $ZSTD -l -
+! $ZSTD -l < tmp1.zst
+! $ZSTD -l - < tmp1.zst
+! $ZSTD -l - tmp1.zst
+! $ZSTD -l - tmp1.zst < tmp1.zst
+$ZSTD -l tmp1.zst < tmp1.zst # but doesn't error just because stdin is not a tty
$ECHO "\n===> zstd --list/-l test with null files "
./datagen -g0 > tmp5
--
2.16.4

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea
size 1706005

3
zstd-1.3.7.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3277f236df0ca6edae01ae84e865470000c5a3484588fd5bc3d869877fd3573d
size 1813285

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Wed Oct 24 08:29:38 UTC 2018 - astieger@suse.com
- zstd 1.3.7:
* fix ratio for dictionary compression at levels 9 and 10
* add man pages for zstdless and zstdgrep
- includes changes from zstd 1.3.6:
* faster dictionary builder, also the new default for --train
* previous (slower, slightly higher quality) dictionary builder
to be selected via --train-cover
* Faster dictionary decompression and compression under memory
limits with many dictionaries used simultaneously
* New command --adapt for compressed network piping of data
adjusted to the perceived network conditions
- drop zstd-1.3.5-fix-list-stdin.patch, upstream
- switch from git tag snaphshot to bootstrapped tarball
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 3 08:13:06 UTC 2018 - astieger@suse.com Tue Jul 3 08:13:06 UTC 2018 - astieger@suse.com

View File

@ -19,16 +19,15 @@
%define major 1 %define major 1
%define libname lib%{name}%{major} %define libname lib%{name}%{major}
Name: zstd Name: zstd
Version: %{major}.3.5 Version: %{major}.3.7
Release: 0 Release: 0
Summary: Zstandard compression tools Summary: Zstandard compression tools
License: BSD-3-Clause AND GPL-2.0-only License: BSD-3-Clause AND GPL-2.0-only
Group: Productivity/Archiving/Compression Group: Productivity/Archiving/Compression
URL: https://github.com/facebook/zstd URL: https://github.com/facebook/zstd
Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: https://github.com/facebook/zstd/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch1: pzstd.1.patch Patch1: pzstd.1.patch
Patch2: pzstd-global-gtest.patch Patch2: pzstd-global-gtest.patch
Patch3: zstd-1.3.5-fix-list-stdin.patch
BuildRequires: gcc BuildRequires: gcc
# C++ is needed for pzstd only # C++ is needed for pzstd only
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -83,7 +82,6 @@ Needed for compiling programs that link with the library.
%setup -q %setup -q
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%build %build
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
@ -104,34 +102,23 @@ install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd
install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1 install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
%files %files
%doc NEWS README.md
%{_bindir}/zstd
%{_bindir}/zstdcat
%{_bindir}/zstdgrep
%{_bindir}/zstdless
%{_bindir}/zstdmt
%{_bindir}/unzstd
%{_bindir}/pzstd
%{_mandir}/man1/zstd.1%{?ext_man}
%{_mandir}/man1/unzstd.1%{?ext_man}
%{_mandir}/man1/zstdcat.1%{?ext_man}
%{_mandir}/man1/pzstd.1%{?ext_man}
%license COPYING LICENSE %license COPYING LICENSE
%doc NEWS README.md
%{_bindir}/*
%{_mandir}/man1/*.1%{?ext_man}
%files -n %{libname} %files -n %{libname}
%{_libdir}/libzstd.so.*
%license COPYING LICENSE %license COPYING LICENSE
%{_libdir}/libzstd.so.*
%files -n lib%{name}-devel %files -n lib%{name}-devel
%license COPYING LICENSE %license COPYING LICENSE
%{_includedir}/zbuff.h %{_includedir}/*.h
%{_includedir}/zdict.h
%{_includedir}/zstd.h
%{_includedir}/zstd_errors.h
%{_libdir}/pkgconfig/libzstd.pc %{_libdir}/pkgconfig/libzstd.pc
%{_libdir}/libzstd.so %{_libdir}/libzstd.so
%files -n lib%{name}-devel-static %files -n lib%{name}-devel-static
%license COPYING LICENSE
%{_libdir}/libzstd.a %{_libdir}/libzstd.a
%post -n %{libname} -p /sbin/ldconfig %post -n %{libname} -p /sbin/ldconfig