Skip to content

Commit

Permalink
Imported Debian patch 7.5-6
Browse files Browse the repository at this point in the history
  • Loading branch information
mstone232 authored and SamB committed Nov 22, 2012
1 parent f9d0def commit 54eafb8
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 26 deletions.
22 changes: 0 additions & 22 deletions coreutils.diff

This file was deleted.

12 changes: 10 additions & 2 deletions debian/changelog
@@ -1,8 +1,16 @@
coreutils (7.5-6) unstable; urgency=low

* remove usr/share/info/dir.gz in build rules (Closes: #546016)
* [83] make sure tail -f flushes initial output before waiting
(Closes: #545422)

-- Michael Stone <mstone@debian.org> Fri, 11 Sep 2009 05:59:32 -0400

coreutils (7.5-5) unstable; urgency=low

* update standards version to 3.8.3.0 (no changes)
* fix "function not implemented" in cp -a of symlink on older linux
kernels (Closes: #545306)
* [82] fix "function not implemented" in cp -a of symlink on older
linux kernels (Closes: #545306)

-- Michael Stone <mstone@debian.org> Thu, 10 Sep 2009 20:07:24 -0400

Expand Down
1 change: 1 addition & 0 deletions debian/patches/00list
Expand Up @@ -6,3 +6,4 @@
80_tail-2_wait_max-unchanged-stats
81_tail-f-
82_symlink_utimensat_enosys
83_tail_flush
2 changes: 1 addition & 1 deletion debian/patches/80_tail-2_wait_max-unchanged-stats.dpatch
@@ -1,5 +1,5 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 80_tail-2_wait.dpatch by Petr Salinger <Petr.Salinger@seznam.cz>
## 80_tail-2_wait_max-unchanged-stats.dpatch by Petr Salinger <Petr.Salinger@seznam.cz>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: fix problem that inode checking isn't done quickly enough
Expand Down
2 changes: 1 addition & 1 deletion debian/patches/82_symlink_utimensat_enosys.dpatch
Expand Up @@ -2,7 +2,7 @@
## 82_symlink_utimensat_enosys.dpatch by Michael Stone <mstone@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
## DP: ignore ENOSYS errors when trying to set symlink times

@DPATCH@
diff -urNad coreutils-7.5~/src/copy.c coreutils-7.5/src/copy.c
Expand Down
127 changes: 127 additions & 0 deletions debian/patches/83_tail_flush.dpatch
@@ -0,0 +1,127 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 83_tail_flush.dpatch by Jim Meyering <meyering@redhat.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: flush initial output before possibly blocking

@DPATCH@
diff -urNad coreutils-7.5~/NEWS coreutils-7.5/NEWS
--- coreutils-7.5~/NEWS 2009-09-11 05:56:07.000000000 -0400
+++ coreutils-7.5/NEWS 2009-09-11 05:56:16.080040689 -0400
@@ -45,6 +45,11 @@
nl --page-increment: deprecated in favor of --line-increment, the new option
maintains the previous semantics and the same short option, -i.

+ tail -f (inotify-enabled) now flushes any initial output before blocking.
+ Before, this would print nothing and wait: stdbuf -o 4K tail -f /etc/passwd
+ Note that this bug affects tail -f only when its standard output is buffered,
+ which is relatively unusual.
+
** New features

chroot now accepts the options --userspec and --groups.
diff -urNad coreutils-7.5~/src/tail.c coreutils-7.5/src/tail.c
--- coreutils-7.5~/src/tail.c 2009-09-11 05:56:15.796040675 -0400
+++ coreutils-7.5/src/tail.c 2009-09-11 05:58:13.367648405 -0400
@@ -1442,7 +1442,6 @@
if (fflush (stdout) != 0)
error (EXIT_FAILURE, errno, _("write error"));
}
-
}
#endif

@@ -2027,6 +2026,12 @@
error (0, errno, _("inotify cannot be used, reverting to polling"));
else
{
+ /* Flush any output from tail_file, now, since
+ tail_forever_inotify flushes only after writing,
+ not before reading. */
+ if (fflush (stdout) != 0)
+ error (EXIT_FAILURE, errno, _("write error"));
+
tail_forever_inotify (wd, F, n_files, sleep_interval);

/* The only way the above returns is upon failure. */
diff -urNad coreutils-7.5~/src/tail.c.rej coreutils-7.5/src/tail.c.rej
--- coreutils-7.5~/src/tail.c.rej 1969-12-31 19:00:00.000000000 -0500
+++ coreutils-7.5/src/tail.c.rej 2009-09-11 05:56:16.080040689 -0400
@@ -0,0 +1,21 @@
+*************** main (int argc, char **argv)
+*** 2033,2038 ****
+ error (0, errno, _("inotify cannot be used, reverting to polling"));
+ else
+ {
+ tail_forever_inotify (wd, F, n_files, sleep_interval);
+
+ /* The only way the above returns is upon failure. */
+--- 2032,2043 ----
+ error (0, errno, _("inotify cannot be used, reverting to polling"));
+ else
+ {
++ /* Flush any output from tail_file, now, since
++ tail_forever_inotify flushes only after writing,
++ not before reading. */
++ if (fflush (stdout) != 0)
++ error (EXIT_FAILURE, errno, _("write error"));
++
+ tail_forever_inotify (wd, F, n_files, sleep_interval);
+
+ /* The only way the above returns is upon failure. */
diff -urNad coreutils-7.5~/tests/Makefile.am coreutils-7.5/tests/Makefile.am
--- coreutils-7.5~/tests/Makefile.am 2009-09-11 05:56:07.000000000 -0400
+++ coreutils-7.5/tests/Makefile.am 2009-09-11 05:56:16.080040689 -0400
@@ -422,6 +422,7 @@
rmdir/t-slash \
tail-2/assert-2 \
tail-2/big-4gb \
+ tail-2/flush-initial \
tail-2/proc-ksyms \
tail-2/start-middle \
touch/dangling-symlink \
diff -urNad coreutils-7.5~/tests/tail-2/flush-initial coreutils-7.5/tests/tail-2/flush-initial
--- coreutils-7.5~/tests/tail-2/flush-initial 1969-12-31 19:00:00.000000000 -0500
+++ coreutils-7.5/tests/tail-2/flush-initial 2009-09-11 05:56:16.080040689 -0400
@@ -0,0 +1,41 @@
+#!/bin/sh
+# inotify-based tail -f didn't flush its initial output before blocking
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if test "$VERBOSE" = yes; then
+ set -x
+ tail --version
+fi
+
+. $srcdir/test-lib.sh
+
+fail=0
+echo line > in || fail=1
+stdbuf --output=1K tail -f in > out &
+tail_pid=$!
+
+# Wait for the backgrounded `tail' to start.
+while :; do
+ env kill -0 $tail_pid && break
+ sleep .1
+done
+
+test -s out || fail=1
+
+kill $tail_pid
+
+Exit $fail
3 changes: 3 additions & 0 deletions debian/rules
Expand Up @@ -133,6 +133,9 @@ endif
sed s/\"1\"/\"8\"/1 $(d)/usr/share/man/man1/chroot.1 > $(d)/usr/share/man/man8/chroot.8
rm $(d)/usr/share/man/man1/chroot.1

# some build environments will leave a dangling info dir.gz
rm -f $(d)/usr/share/info/dir.gz

cp AUTHORS \
NEWS README \
THANKS \
Expand Down

0 comments on commit 54eafb8

Please sign in to comment.