summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2018-07-02 20:09:50 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2018-07-02 20:19:07 +0200
commita62764bdbbc3a2bdb50047f861261bcbfd0abd77 (patch)
tree567eb411a748980fdbc41c61d546d8584aa06765 /gnu
parent8ef7ecf4696846e747570a0b66226bf3accf9d76 (diff)
gnu: zstd: Update to 1.3.5.
* gnu/packages/compression.scm (zstd): Update to 1.3.5. [source]: Add two patches to make the test suite pass. * gnu/packages/patches/zstd-fix-stdin-list-without-tty.patch, gnu/packages/patches/zstd-fix-stdin-list-test.patch: New files. * gnu/local.mk (dist_patch_DATA): Add both.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk4
-rw-r--r--gnu/packages/compression.scm8
-rw-r--r--gnu/packages/patches/zstd-fix-stdin-list-test.patch30
-rw-r--r--gnu/packages/patches/zstd-fix-stdin-list-without-tty.patch67
4 files changed, 106 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 0776be05ec4..10b61ba1baa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1223,7 +1223,9 @@ dist_patch_DATA = \
1223 %D%/packages/patches/xinetd-fix-fd-leak.patch \ 1223 %D%/packages/patches/xinetd-fix-fd-leak.patch \
1224 %D%/packages/patches/xinetd-CVE-2013-4342.patch \ 1224 %D%/packages/patches/xinetd-CVE-2013-4342.patch \
1225 %D%/packages/patches/xmodmap-asprintf.patch \ 1225 %D%/packages/patches/xmodmap-asprintf.patch \
1226 %D%/packages/patches/zathura-plugindir-environment-variable.patch 1226 %D%/packages/patches/zathura-plugindir-environment-variable.patch \
1227 %D%/packages/patches/zstd-fix-stdin-list-without-tty.patch \
1228 %D%/packages/patches/zstd-fix-stdin-list-test.patch
1227 1229
1228MISC_DISTRO_FILES = \ 1230MISC_DISTRO_FILES = \
1229 %D%/packages/ld-wrapper.in 1231 %D%/packages/ld-wrapper.in
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index de3acaedc09..2ca431b2c12 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1649,7 +1649,7 @@ or junctions, and always follows hard links.")
1649(define-public zstd 1649(define-public zstd
1650 (package 1650 (package
1651 (name "zstd") 1651 (name "zstd")
1652 (version "1.3.4") 1652 (version "1.3.5")
1653 (source (origin 1653 (source (origin
1654 (method url-fetch) 1654 (method url-fetch)
1655 (uri (string-append "https://github.com/facebook/zstd/archive/v" 1655 (uri (string-append "https://github.com/facebook/zstd/archive/v"
@@ -1657,7 +1657,11 @@ or junctions, and always follows hard links.")
1657 (file-name (string-append name "-" version ".tar.gz")) 1657 (file-name (string-append name "-" version ".tar.gz"))
1658 (sha256 1658 (sha256
1659 (base32 1659 (base32
1660 "1a85sqk4z5b2jfp7fqkr38ibql8mdzca32lf4i3bssyjimp1pr4j")))) 1660 "1sifbq18p0hc978g0pq8fymrlpzz1fcxqkbxfqk44z6v9jg5bqfn"))
1661 ;; Fix a regression that causes the tests to fail. Both patches
1662 ;; have been merged upstream and will be part of the next release.
1663 (patches (search-patches "zstd-fix-stdin-list-without-tty.patch"
1664 "zstd-fix-stdin-list-test.patch"))))
1661 (build-system gnu-build-system) 1665 (build-system gnu-build-system)
1662 (arguments 1666 (arguments
1663 `(#:phases 1667 `(#:phases
diff --git a/gnu/packages/patches/zstd-fix-stdin-list-test.patch b/gnu/packages/patches/zstd-fix-stdin-list-test.patch
new file mode 100644
index 00000000000..a10355448c9
--- /dev/null
+++ b/gnu/packages/patches/zstd-fix-stdin-list-test.patch
@@ -0,0 +1,30 @@
1From 8e7bdc18d62632adcee029b2f8f5013d11549dd7 Mon Sep 17 00:00:00 2001
2From: "W. Felix Handte" <w@felixhandte.com>
3Date: Fri, 29 Jun 2018 16:31:22 -0400
4Subject: [PATCH] Fix Tests of `--list` Behavior with `stdin`
5
6---
7 tests/playTests.sh | 10 ++++++++--
8 1 file changed, 8 insertions(+), 2 deletions(-)
9
10diff --git a/tests/playTests.sh b/tests/playTests.sh
11index 09a7377f2..aa5535d59 100755
12--- a/tests/playTests.sh
13+++ b/tests/playTests.sh
14@@ -731,8 +731,14 @@ $ECHO "\n===> zstd --list/-l error detection tests "
15 ! $ZSTD -lv tmp1*
16 ! $ZSTD --list -v tmp2 tmp12.zst
17
18-$ECHO "\n===> zstd --list/-l exits 1 when stdin is piped in"
19-! echo "piped STDIN" | $ZSTD --list
20+$ECHO "\n===> zstd --list/-l errors when presented with stdin / no files"
21+! $ZSTD -l
22+! $ZSTD -l -
23+! $ZSTD -l < tmp1.zst
24+! $ZSTD -l - < tmp1.zst
25+! $ZSTD -l - tmp1.zst
26+! $ZSTD -l - tmp1.zst < tmp1.zst
27+$ZSTD -l tmp1.zst < tmp1.zst # but doesn't error just because stdin is not a tty
28
29 $ECHO "\n===> zstd --list/-l test with null files "
30 ./datagen -g0 > tmp5
diff --git a/gnu/packages/patches/zstd-fix-stdin-list-without-tty.patch b/gnu/packages/patches/zstd-fix-stdin-list-without-tty.patch
new file mode 100644
index 00000000000..47fa3e59a71
--- /dev/null
+++ b/gnu/packages/patches/zstd-fix-stdin-list-without-tty.patch
@@ -0,0 +1,67 @@
1From 712a9fd9721c314f4b0238577d803b012845f6d2 Mon Sep 17 00:00:00 2001
2From: "W. Felix Handte" <w@felixhandte.com>
3Date: Fri, 29 Jun 2018 15:33:44 -0400
4Subject: [PATCH] Allow Invoking `zstd --list` When `stdin` is not a `tty`
5
6Also now returns an error when no inputs are given.
7
8New proposed behavior:
9
10```
11felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l; echo $?
12No files given
131
14felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Makefile.zst; echo $?
15Frames Skips Compressed Uncompressed Ratio Check Filename
16 1 0 3.08 KB 10.92 KB 3.544 XXH64 Makefile.zst
170
18felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l <Makefile.zst; echo $?
19zstd: --list does not support reading from standard input
20No files given
211
22felix@odin:~/prog/zstd (list-stdin-check)$ ./zstd -l Makefile.zst <Makefile.zst; echo $?
23Frames Skips Compressed Uncompressed Ratio Check Filename
24 1 0 3.08 KB 10.92 KB 3.544 XXH64 Makefile.zst
250
26felix@odin:~/prog/zstd (list-stdin-check)$
27```
28---
29 programs/fileio.c | 16 ++++++++++------
30 1 file changed, 10 insertions(+), 6 deletions(-)
31
32diff --git a/programs/fileio.c b/programs/fileio.c
33index 0175b3163..b4eed28d1 100644
34--- a/programs/fileio.c
35+++ b/programs/fileio.c
36@@ -2017,21 +2017,25 @@ static int FIO_listFile(fileInfo_t* total, const char* inFileName, int displayLe
37 }
38
39 int FIO_listMultipleFiles(unsigned numFiles, const char** filenameTable, int displayLevel){
40-
41- if (!IS_CONSOLE(stdin)) {
42- DISPLAYOUT("zstd: --list does not support reading from standard input\n");
43- return 1;
44+ unsigned u;
45+ for (u=0; u<numFiles;u++) {
46+ if (!strcmp (filenameTable[u], stdinmark)) {
47+ DISPLAYOUT("zstd: --list does not support reading from standard input\n");
48+ return 1;
49+ }
50 }
51
52 if (numFiles == 0) {
53+ if (!IS_CONSOLE(stdin)) {
54+ DISPLAYOUT("zstd: --list does not support reading from standard input\n");
55+ }
56 DISPLAYOUT("No files given\n");
57- return 0;
58+ return 1;
59 }
60 if (displayLevel <= 2) {
61 DISPLAYOUT("Frames Skips Compressed Uncompressed Ratio Check Filename\n");
62 }
63 { int error = 0;
64- unsigned u;
65 fileInfo_t total;
66 memset(&total, 0, sizeof(total));
67 total.usesCheck = 1;