Date: Tuesday, April 26, 2016 @ 18:31:45 Author: seblu Revision: 266177
upgpkg: gzip 1.7-2 - fix FS#49068 Added: gzip/trunk/01-fix-bug-with-l-output-to-pipes.patch Modified: gzip/trunk/PKGBUILD -----------------------------------------+ 01-fix-bug-with-l-output-to-pipes.patch | 45 ++++++++++++++++++++++++++++++ PKGBUILD | 20 +++++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) Added: 01-fix-bug-with-l-output-to-pipes.patch =================================================================== --- 01-fix-bug-with-l-output-to-pipes.patch (rev 0) +++ 01-fix-bug-with-l-output-to-pipes.patch 2016-04-26 16:31:45 UTC (rev 266177) @@ -0,0 +1,45 @@ +From 3557cd57906915eb9c990b5f386e25c395592643 Mon Sep 17 00:00:00 2001 +From: Paul Eggert <[email protected]> +Date: Wed, 20 Apr 2016 00:43:09 +0000 +Subject: gzip: fix bug with -l output to pipes + +Problem reported by Christian Franke via Eric Blake in: +http://bugs.gnu.org/23314 +* NEWS: Mention this. +* gzip.c (main): Do not close stdout twice when given -l. +Instead, -l now just fflushes stdout, so that fdatasync +can synchronize it if --synchronize is also specified. +* tests/list: New test case. +* tests/Makefile.am (TESTS): Add it. +--- +diff --git a/gzip.c b/gzip.c +index d66530a..3b8de4d 100644 +--- a/gzip.c ++++ b/gzip.c +@@ -664,14 +664,16 @@ int main (int argc, char **argv) + } else { /* Standard input */ + treat_stdin(); + } +- if (list && !quiet && file_count > 1) { +- do_list(-1, -1); /* print totals */ +- } +- if (to_stdout +- && ((synchronous +- && (fdatasync (STDOUT_FILENO) != 0 && errno != EINVAL)) +- || close (STDOUT_FILENO) != 0) +- && errno != EBADF) ++ if (list) ++ { ++ /* Output any totals, and check for output errors. */ ++ if (!quiet && 1 < file_count) ++ do_list (-1, -1); ++ if (fflush (stdout) != 0) ++ write_error (); ++ } ++ if (to_stdout && synchronous && fdatasync (STDOUT_FILENO) != 0 ++ && errno != EINVAL && errno != EBADF) + write_error (); + do_exit(exit_code); + return exit_code; /* just to avoid lint warning */ +-- +cgit v0.9.0.2 Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-04-26 16:21:50 UTC (rev 266176) +++ PKGBUILD 2016-04-26 16:31:45 UTC (rev 266177) @@ -5,7 +5,7 @@ pkgname=gzip pkgver=1.7 -pkgrel=1 +pkgrel=2 pkgdesc='GNU compression utility' arch=('i686' 'x86_64') url='http://www.gnu.org/software/gzip/' @@ -14,9 +14,23 @@ depends=('glibc' 'bash' 'less') install=gzip.install validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering -source=("ftp://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz"{,.sig}) +source=("ftp://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz"{,.sig} + '01-fix-bug-with-l-output-to-pipes.patch') md5sums=('d9ae97206a703a20e6c1c868deb3eb47' - 'SKIP') + 'SKIP' + '3fc4318cec1f036b5c340e8aa228005c') +prepare() { + cd $pkgname-$pkgver + # apply patch from the source array (should be a pacman feature) + local filename + for filename in "${source[@]}"; do + if [[ "$filename" =~ \.patch$ ]]; then + msg2 "Applying patch $filename" + patch -p1 -N -i "$srcdir/$filename" + fi + done + : +} build() { cd $pkgname-$pkgver
