[arch-commits] Commit in zstd/repos (3 files)
Bartłomiej Piotrowski
bpiotrowski at archlinux.org
Tue Jul 3 10:20:39 UTC 2018
Date: Tuesday, July 3, 2018 @ 10:20:39
Author: bpiotrowski
Revision: 327926
archrelease: copy trunk to testing-x86_64
Added:
zstd/repos/testing-x86_64/
zstd/repos/testing-x86_64/PKGBUILD
(from rev 327925, zstd/trunk/PKGBUILD)
zstd/repos/testing-x86_64/zstd-1.3.5-fix-tests.patch
(from rev 327925, zstd/trunk/zstd-1.3.5-fix-tests.patch)
----------------------------+
PKGBUILD | 44 +++++++++++++++++++
zstd-1.3.5-fix-tests.patch | 97 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 141 insertions(+)
Copied: zstd/repos/testing-x86_64/PKGBUILD (from rev 327925, zstd/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2018-07-03 10:20:39 UTC (rev 327926)
@@ -0,0 +1,44 @@
+# $Id$
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+# Contributor: Andrzej Giniewicz <gginiu at gmail.com>
+# Contributor: Johan Förberg <johan at forberg.se>
+
+pkgname=zstd
+pkgver=1.3.5
+pkgrel=1
+pkgdesc='Zstandard - Fast real-time compression algorithm'
+arch=(x86_64)
+url='http://www.zstd.net/'
+license=(BSD GPL2)
+depends=(zlib xz lz4)
+makedepends=(gtest)
+source=(zstd-$pkgver.tar.gz::https://github.com/facebook/zstd/archive/v${pkgver}.tar.gz
+ zstd-1.3.5-fix-tests.patch)
+sha256sums=('d6e1559e4cdb7c4226767d4ddc990bff5f9aab77085ff0d0490c828b025e2eea'
+ '3c34c2aed193595559c1b3cb4503d81c73d3e21dcf8ab659b26aa917abcb194c')
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -p1 -i "$srcdir/zstd-1.3.5-fix-tests.patch"
+}
+
+build() {
+ cd $pkgname-$pkgver
+ make
+ make zstdmt
+ make -C contrib/pzstd
+}
+
+check() {
+ cd $pkgname-$pkgver
+ make check
+ make -C contrib/pzstd test
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make PREFIX=/usr DESTDIR="$pkgdir/" install
+ install -Dm755 zstdmt "$pkgdir/usr/bin/zstdmt"
+ install -Dm755 contrib/pzstd/pzstd "$pkgdir/usr/bin/pzstd"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
Copied: zstd/repos/testing-x86_64/zstd-1.3.5-fix-tests.patch (from rev 327925, zstd/trunk/zstd-1.3.5-fix-tests.patch)
===================================================================
--- testing-x86_64/zstd-1.3.5-fix-tests.patch (rev 0)
+++ testing-x86_64/zstd-1.3.5-fix-tests.patch 2018-07-03 10:20:39 UTC (rev 327926)
@@ -0,0 +1,97 @@
+From 712a9fd9721c314f4b0238577d803b012845f6d2 Mon Sep 17 00:00:00 2001
+From: "W. Felix Handte" <w at felixhandte.com>
+Date: Fri, 29 Jun 2018 15:33:44 -0400
+Subject: [PATCH] Allow Invoking `zstd --list` When `stdin` is not a `tty`
+
+Also now returns an error when no inputs are given.
+
+New proposed behavior:
+
+```
+felix at odin:~/prog/zstd (list-stdin-check)$ ./zstd -l; echo $?
+No files given
+1
+felix at 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 at 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 at 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 at 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 0175b3163..b4eed28d1 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;
+From 8e7bdc18d62632adcee029b2f8f5013d11549dd7 Mon Sep 17 00:00:00 2001
+From: "W. Felix Handte" <w at felixhandte.com>
+Date: Fri, 29 Jun 2018 16:31:22 -0400
+Subject: [PATCH] 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 09a7377f2..aa5535d59 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
More information about the arch-commits
mailing list