Re: Bug#545422: coreutils: tail -f - fails

2009-09-07 Thread Jim Meyering
Bill Brelsford wrote: Package: coreutils Version: 7.5-3 Severity: normal tail -f no longer works with stdin. E.g. commands such as somecommand | tail -f - somecommand | tail -f tail -f /var/log/kern fail with the message: tail: cannot watch `-': No such file

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Ondřej Vašík
Hi, Jim Meyering wrote: Pádraig Brady wrote: Ondřej Vašík wrote: As reported in http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00342.html by Ernest N. Mamikonyan, cp/mv fails to preserve extended attributes for read-only source files. Following patch fixes the issue for

seq, why so slow?

2009-09-07 Thread Philip Rowlands
The conversion of everything to long doubles internally makes seq a lot slower than it needs to be in integer cases, I assume from the use of floating-point multiplication for every line of output: seq.c:257 x = first + i * step; $ time seq 100 /dev/null real0m1.616s user

Re: seq, why so slow?

2009-09-07 Thread Pádraig Brady
Philip Rowlands wrote: The conversion of everything to long doubles internally makes seq a lot slower than it needs to be in integer cases, I assume from the use of floating-point multiplication for every line of output: seq.c:257 x = first + i * step; $ time seq 100

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Pádraig Brady
Ondřej Vašík wrote: Ah, I knew I forgot to do something :). Thanks for spotting this. Restoring to dest_mode ~omitted_permissions done in attached patch, dropped redirections from the test as well. Additionally - I modified the copy.c patch a bit - failure of mode change now doesn't mean

new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
There have been disproportionately many bug fixes since coreutils-7.5. It's an interesting mix of fixes for recent regressions and for a few older bugs. coreutils snapshot: http://meyering.net/cu/coreutils-ss.tar.gz http://meyering.net/cu/coreutils-ss.tar.xz

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Jim Meyering
Ondřej Vašík wrote: Ah, I knew I forgot to do something :). Thanks for spotting this. Restoring to dest_mode ~omitted_permissions done in attached patch, dropped redirections from the test as well. Additionally - I modified the copy.c patch a bit - failure of mode change now doesn't mean

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Ondřej Vašík
Pádraig Brady wrote: Ondřej Vašík wrote: Ah, I knew I forgot to do something :). Thanks for spotting this. Restoring to dest_mode ~omitted_permissions done in attached patch, dropped redirections from the test as well. Additionally - I modified the copy.c patch a bit - failure of mode

Re: Bug#545422: coreutils: tail -f - fails

2009-09-07 Thread Giuseppe Scrivano
Hi Jim, what do you think about the following solution? It avoids to revert to the old polling mechanism using /dev/stdin instead of - to inotify_add_watch. Cheers, Giuseppe diff --git a/src/tail.c b/src/tail.c index e3b9529..016b712 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1152,6

Re: Bug#545422: coreutils: tail -f - fails

2009-09-07 Thread Jim Meyering
Giuseppe Scrivano wrote: what do you think about the following solution? It avoids to revert to the old polling mechanism using /dev/stdin instead of - to inotify_add_watch. I considered that and discussed the trade-off in the comment I committed. There have been systems and configurations

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
Eric Blake wrote: According to Jim Meyering on 9/7/2009 3:09 AM: ls -i now prints consistent inode numbers also for mount points. This makes ls -i DIR less efficient on systems with dysfunctional readdir, because ls must stat every file in order to obtain a guaranteed-valid inode

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Pádraig Brady
Ondřej Vašík wrote: Pádraig Brady wrote: To minimize side affects perhaps we should only do the chmod(600) if (geteuid () != 0 !access (src_name, W_OK)) ? Good idea, it would reduce possibility of security leak, playing with access rights is always a bit dangerous (although here we play

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Andreas Schwab
Eric Blake e...@byu.net writes: In other words, are we guaranteed that mount points can only occur atop directories, and that we can avoid the stat() for regular files? You can also (bind-)mount regular files. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Andreas Schwab on 9/7/2009 5:17 AM: Eric Blake e...@byu.net writes: In other words, are we guaranteed that mount points can only occur atop directories, and that we can avoid the stat() for regular files? You can also (bind-)mount

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Pádraig Brady
Jim Meyering wrote: Eric Blake wrote: According to Jim Meyering on 9/7/2009 3:09 AM: ls -i now prints consistent inode numbers also for mount points. This makes ls -i DIR less efficient on systems with dysfunctional readdir, because ls must stat every file in order to obtain a

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Ondřej Vašík
Pádraig Brady wrote: Ondřej Vašík wrote: Pádraig Brady wrote: To minimize side affects perhaps we should only do the chmod(600) if (geteuid () != 0 !access (src_name, W_OK)) ? Good idea, it would reduce possibility of security leak, playing with access rights is always a bit

Re: the unicode arrow

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Michal Svoboda on 9/6/2009 5:33 AM: When doing cp -va I can see neat quotes (depending on locale), as in „blah“, but the arrow is still composed of a dash and a greater-than symbol, as in -. Is there any plan to make the arrow also

Re: the unicode arrow

2009-09-07 Thread Erik Auerswald
Hi, On Mon, Sep 07, 2009 at 07:23:12AM -0600, Eric Blake wrote: According to Michal Svoboda on 9/6/2009 5:33 AM: When doing cp -va I can see neat quotes (depending on locale), as in „blah“, but the arrow is still composed of a dash and a greater-than symbol, as in -. Is there any plan to

Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files

2009-09-07 Thread Pádraig Brady
Ondřej Vašík wrote: Pádraig Brady wrote: Ondřej Vašík wrote: Pádraig Brady wrote: To minimize side affects perhaps we should only do the chmod(600) if (geteuid () != 0 !access (src_name, W_OK)) ? Good idea, it would reduce possibility of security leak, playing with access rights is always

Re: the unicode arrow

2009-09-07 Thread Pádraig Brady
Erik Auerswald wrote: Hi, On Mon, Sep 07, 2009 at 07:23:12AM -0600, Eric Blake wrote: According to Michal Svoboda on 9/6/2009 5:33 AM: When doing cp -va I can see neat quotes (depending on locale), as in „blah“, but the arrow is still composed of a dash and a greater-than symbol, as in -.

Re: the unicode arrow

2009-09-07 Thread Philip Rowlands
On Mon, 7 Sep 2009, Eric Blake wrote: This was discussed last month. The verdict is no. http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00048.html This list archive has done strange things with character encodings which make the discussion difficult to follow. Something along the

Re: the unicode arrow

2009-09-07 Thread Jim Meyering
Philip Rowlands wrote: On Mon, 7 Sep 2009, Eric Blake wrote: This was discussed last month. The verdict is no. http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00048.html This list archive has done strange things with character encodings which make the discussion difficult to

Re: the unicode arrow

2009-09-07 Thread Pádraig Brady
Philip Rowlands wrote: On Mon, 7 Sep 2009, Eric Blake wrote: This was discussed last month. The verdict is no. http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00048.html This list archive has done strange things with character encodings which make the discussion difficult to

Re: the unicode arrow

2009-09-07 Thread Michal Svoboda
Pádraig Brady wrote 1276 bytes: Also some scripts may be depending on the output from `cp -v`, so I'm not on for changing it. The output is already changed (the neat quotes). And one can use LC_ALL=POSIX to get rid of both.

Re: the unicode arrow

2009-09-07 Thread Pádraig Brady
Pádraig Brady wrote: Philip Rowlands wrote: On Mon, 7 Sep 2009, Eric Blake wrote: This was discussed last month. The verdict is no. http://lists.gnu.org/archive/html/bug-coreutils/2009-08/msg00048.html This list archive has done strange things with character encodings which make the

Re: Bug#545422: coreutils: tail -f - fails

2009-09-07 Thread Giuseppe Scrivano
Jim Meyering j...@meyering.net writes: I considered that and discussed the trade-off in the comment I committed. There have been systems and configurations with nonexistent and unusable /dev/stdin files. sorry, I didn't read you comment. This patch changes `tail' to handle stdin separately

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Erik Auerswald
Hi Jim, On Mon, Sep 07, 2009 at 11:09:21AM +0200, Jim Meyering wrote: There have been disproportionately many bug fixes since coreutils-7.5. It's an interesting mix of fixes for recent regressions and for a few older bugs. coreutils snapshot: http://meyering.net/cu/coreutils-ss.tar.gz

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
Erik Auerswald wrote: ... http://meyering.net/cu/coreutils-7.5.65-61cc6.tar.gz http://meyering.net/cu/coreutils-7.5.65-61cc6.tar.xz Hi Erik, I've run the non-root checks without failures on my debian/sid x86 (32 bit) system. Good to know. That's one I hadn't tested. Thanks!

Re: Bug#545422: coreutils: tail -f - fails

2009-09-07 Thread Jim Meyering
Giuseppe Scrivano wrote: Jim Meyering j...@meyering.net writes: I considered that and discussed the trade-off in the comment I committed. There have been systems and configurations with nonexistent and unusable /dev/stdin files. sorry, I didn't read you comment. This patch changes `tail'

Re: the unicode arrow

2009-09-07 Thread Andreas Schwab
Pádraig Brady p...@draigbrady.com writes: # quick dir listing with latest files/dirs at the bottom, # prettify symlink arrows. # using eval to precompute the tput sequences. eval l() { ls -lrt --color=always \\...@\ | sed 's/ - / $(tput bold)▪▶$(tput sgr0) /' FWIW, I find this arrow

ln can't backup directories

2009-09-07 Thread Bert Wesarg
Hi all, I'm failing in creating a symlink where the destination is a directory and do a backup of this directory. This is what I tried: $ mkdir a $ ln -s --no-target-directory --backup=numbered b a ln: `a': cannot overwrite directory Looking at the code I can seen the reason, the backup

Re: the unicode arrow

2009-09-07 Thread Pádraig Brady
Andreas Schwab wrote: Pádraig Brady p...@draigbrady.com writes: # quick dir listing with latest files/dirs at the bottom, # prettify symlink arrows. # using eval to precompute the tput sequences. eval l() { ls -lrt --color=always \\...@\ | sed 's/ - / $(tput bold)▪▶$(tput sgr0) /'

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Pádraig Brady
Jim Meyering wrote: There have been disproportionately many bug fixes since coreutils-7.5. It's an interesting mix of fixes for recent regressions and for a few older bugs. Passed Skipped Failed \- Fedora core 5

Re: merge rename and rename-dest-slash

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 9/7/2009 10:30 AM: Any objections to deleting the rename-dest-slash module? It performs a subset of the rename module, Correction. As currently written, rename.m4 checks whether: rm -rf d1 d2 mkdir d1 rename(d1/,d2)

[PATCH] tests: tail-2/infloop-1: avoid rare test failure on a busy system

2009-09-07 Thread Jim Meyering
I've seen this test fail a few times, recently, but it's not easy to trigger. With this change, I saw no failure in 60 iterations. From 494fed027114d63719439b399a7602f8d0384bcf Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Mon, 7 Sep 2009 11:39:19 +0200 Subject: [PATCH]

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Pádraig Brady on 9/7/2009 10:22 AM: Solaris 9 x86 build failed with: fstatat.c, line 39: undefined symbol: AT_SYMLINK_NOFOLLOW Hmm. That should be taken care of by the gnulib fcntl.h replacement. Are we missing a #include? Can you

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
Pádraig Brady wrote: Jim Meyering wrote: There have been disproportionately many bug fixes since coreutils-7.5. It's an interesting mix of fixes for recent regressions and for a few older bugs. Passed Skipped Failed

Re: windows.h: No such file or directory

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Meyering on 8/22/2009 1:58 AM: John Taylor wrote: I'm trying to build coreutils-7.4 with a cross-compilator (gcc-4.4.1) that runs on i686-unknown-linux-gnu and produces code for x86_64-unknown-linux-gnu. When building coreutils, I

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
Eric Blake wrote: According to Pádraig Brady on 9/7/2009 10:22 AM: Solaris 9 x86 build failed with: fstatat.c, line 39: undefined symbol: AT_SYMLINK_NOFOLLOW Hmm. That should be taken care of by the gnulib fcntl.h replacement. Are we missing a #include? Can you post the full failure?

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Jim Meyering
Eric Blake wrote: Solaris 10 failures: tail-2/flush-initial (patch attached) Hmm. We should reword the NEWS entry (right now, it states that the failure was rare because stdbuf was not always used; but your analysis of this failure proves that it can indeed be more common). Do you know of

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Meyering on 9/7/2009 11:41 AM: Eric Blake wrote: Solaris 10 failures: tail-2/flush-initial (patch attached) Hmm. We should reword the NEWS entry (right now, it states that the failure was rare because stdbuf was not always

misc/cat-buf test failure

2009-09-07 Thread Jim Meyering
Hi Pádraig, On my 6th run of make check, the cat-buf test failed. It's an inherently racy test. If the dd process is starved until 2 is printed, it will end up printing both lines to out. Here's the code: # Use a fifo rather than a pipe in the tests below # so that the producer (cat)

[PATCH] tests: misc/cat-buf: clean up syntax

2009-09-07 Thread Jim Meyering
While I was looking at this test... From a4a864da365fe70eb3a69fd4347f8f747a258efd Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Mon, 7 Sep 2009 20:23:03 +0200 Subject: [PATCH] tests: misc/cat-buf: clean up syntax * tests/misc/cat-buf: Don't suppress dd's stderr. Remove

[PATCH] tail: don't give up on inotify mode for an already-ignored -

2009-09-07 Thread Jim Meyering
My recent change in this area wasn't quite right. For example, before, : k; ./tail -f - k . would revert to sleep-based implementation. With this patch, since - ends up being ignored, the inotify-based implementation is used. From a8d26b3ce1630b6e9213b79d213ad7c699ee9861 Mon Sep 17

Re: tail -f problem

2009-09-07 Thread Jim Meyering
Ulrich Drepper wrote: Jim Meyering wrote: Thanks for the report! Ulrich and Ren reported that the command, echo foobar | tail -c3 -f would block indefinitely, while POSIX says that it must not. Here's how I expect to fix this. Maybe I'm splitting hairs, but rather than call this a bug in

Re: tail -f problem

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Meyering on 9/7/2009 2:48 PM: This seems small and safe enough that I'm leaning toward including it in coreutils-7.6, but I'll wait for a second opinion and/or review. +** POSIX conformance + + tail -f now ignores - when

Re: tail -f problem

2009-09-07 Thread Jim Meyering
Eric Blake wrote: According to Jim Meyering on 9/7/2009 2:48 PM: This seems small and safe enough that I'm leaning toward including it in coreutils-7.6, but I'll wait for a second opinion and/or review. +** POSIX conformance + + tail -f now ignores - when stdin is a pipe or FIFO, per

Re: merge rename and rename-dest-slash

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 9/7/2009 11:12 AM: According to Eric Blake on 9/7/2009 10:30 AM: Any objections to deleting the rename-dest-slash module? It performs a subset of the rename module, Correction. As currently written, rename.m4 checks

Re: misc/cat-buf test failure

2009-09-07 Thread Pádraig Brady
Jim Meyering wrote: Hi Pádraig, On my 6th run of make check, the cat-buf test failed. It's an inherently racy test. If the dd process is starved until 2 is printed, it will end up printing both lines to out. Hmm. 0.2s was too short between writes so. I've bumped it up to 0.5s since 0.2

Re: tail -f problem

2009-09-07 Thread Pádraig Brady
Jim Meyering wrote: Ulrich Drepper wrote: Jim Meyering wrote: Thanks for the report! Ulrich and Ren reported that the command, echo foobar | tail -c3 -f would block indefinitely, while POSIX says that it must not. This seems to be handled already (see line 1926): echo foobar |

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Pádraig Brady
Eric Blake wrote: According to Pádraig Brady on 9/7/2009 10:22 AM: Solaris 9 x86 build failed with: fstatat.c, line 39: undefined symbol: AT_SYMLINK_NOFOLLOW Hmm. That should be taken care of by the gnulib fcntl.h replacement. Are we missing a #include? Can you post the full failure?

Re: new snapshot available: coreutils-7.5.65-61cc6

2009-09-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Pádraig Brady on 9/7/2009 6:32 PM: fstatat.c, line 39: undefined symbol: AT_SYMLINK_NOFOLLOW Hmm. That should be taken care of by the gnulib fcntl.h replacement. Are we missing a #include? Can you post the full failure? gnulib

Re: misc/cat-buf test failure

2009-09-07 Thread Jim Meyering
Pádraig Brady wrote: Hmm. 0.2s was too short between writes so. I've bumped it up to 0.5s since 0.2 failed so infrequently. I've also changed to just skip on possible failure. That should do it. Thanks.