bug#7042: df --help does not show `-m' option

2010-09-17 Thread Pádraig Brady
On 16/09/10 23:34, Paul Eggert wrote:
 On 09/16/10 11:21, Eric Blake wrote:
 document -m, with --block-size=M as the long-option spelling
 add -g, with --block-size=G as the long-option spelling
 
 This doesn't sound like a good idea.  Multi-terabyte disks
 are already here, and df -t is already taken.  Also,
 df -g already means something different in Solaris.
 
 Is it really that hard to type df -Bg?

Yes I agree the current unit selection options are fine.

 If we're going to make incompatible changes, I suggest that
 we solve the problem once and for all, by having df choose
 the default blocksize dynamically, based on the size of the
 output line describing the smallest disk.  For example, where
 df currently outputs this:
 
 Filesystem   1K-blocks  Used Available Use% Mounted on
 /dev/sda111620338002   1437021 11618900981   1% /r/opt
 /dev/sda2 20971520   1335871  19635650   7% /home/eggert
 
 df would notice that the smallest file system is between 1GB and 1TB,
 so it would default to 1 GB blocks, as follows:
 
 Filesystem  1GB-blocks  Used Available Use% Mounted on
 /dev/sda1  11900GB   2GB   11898GB   1% /r/opt
 /dev/sda2 22GB   2GB  21GB   7% /home/eggert
 
 This is much more useful as an output format, because one can visually
 see which file systems are larger by seeing how many digits are there.
 Contrast this to the output of df --si:
 
 Filesystem Size   Used  Avail Use% Mounted on
 /dev/sda1   12T   1.5G12T   1% /r/opt
 /dev/sda2   22G   1.4G21G   7% /home/eggert
 
 which is harder to visually parse that way.

That would break lots of scripts I'd say
(they should use -P, but many don't).
In any case I don't think there is enough benefit
in such a format change given the common wide range
of device sizes attached to systems.
Personally I find the `df -h` format easiest to read.

 While we're at it, we should fix df so that its columns line up better;
 that would be another incompatible change, but it'd be worth it
 on hosts where the file system names are long.

We definitely should do this to support languages
with side column headings, and `df -B\'1`
I've an unfinished local branch to do this with mbsalign()

cheers,
Pádraig.





bug#6402: [PATCH] rm: remove no-op -d option

2010-09-17 Thread Jim Meyering
Eric Blake wrote:
 * src/rm.c (long_opts, main): Resolve a fixme.
 * NEWS: Document the change.
 Based on a report by William Plusnick.
 ---

 Jim, what do you think of this alternative patch, which avoids the
 issue of a new translation string by instead letting getopt parsing
 reject -d like any other unknown option?

I like it.  Thank you.

...
 --- a/NEWS
...
 +  rm -d now issues an error rather than being silently ignored.

How about a slight change in wording to make clear
that the entire rm command was not being ignored.

  rm's -d now evokes an error;  before, it was silently ignored.





bug#7042: df --help does not show `-m' option

2010-09-17 Thread Erik Auerswald
Hi,

On Fri, Sep 17, 2010 at 09:56:57AM +0100, Pádraig Brady wrote:
 On 16/09/10 23:34, Paul Eggert wrote:
  If we're going to make incompatible changes, I suggest that
  we solve the problem once and for all, by having df choose
  the default blocksize dynamically, based on the size of the
  output line describing the smallest disk.  For example, where
  df currently outputs this:
  
  Filesystem   1K-blocks  Used Available Use% Mounted on
  /dev/sda111620338002   1437021 11618900981   1% /r/opt
  /dev/sda2 20971520   1335871  19635650   7% /home/eggert
  
  df would notice that the smallest file system is between 1GB and 1TB,
  so it would default to 1 GB blocks, as follows:
  
  Filesystem  1GB-blocks  Used Available Use% Mounted on
  /dev/sda1  11900GB   2GB   11898GB   1% /r/opt
  /dev/sda2 22GB   2GB  21GB   7% /home/eggert
  
  This is much more useful as an output format, because one can visually
  see which file systems are larger by seeing how many digits are there.
  Contrast this to the output of df --si:
  
  Filesystem Size   Used  Avail Use% Mounted on
  /dev/sda1   12T   1.5G12T   1% /r/opt
  /dev/sda2   22G   1.4G21G   7% /home/eggert
  
  which is harder to visually parse that way.

Yes, especially 1.5G of the 12T disk used looks a lot like 1.5T of 1.5T
used.

 That would break lots of scripts I'd say
 (they should use -P, but many don't).

That's obvious (all three points, sadly).

 In any case I don't think there is enough benefit
 in such a format change given the common wide range
 of device sizes attached to systems.

I like Paul's suggestion. Of course there are corner cases (mounting an
older USB stick with e.g. 128MB). The base could be selected by the
smallest mounted fixed disk.

Erik
-- 
[T]he essence of XML is this: the problem it solves is not hard,
and it does not solve the problem well.
-- The Essence of XML by Jérôme Siméon, Philip Wadler





bug#6402: [PATCH] rm: remove no-op -d option

2010-09-17 Thread Eric Blake

On 09/17/2010 03:13 AM, Jim Meyering wrote:

Jim, what do you think of this alternative patch, which avoids the
issue of a new translation string by instead letting getopt parsing
reject -d like any other unknown option?


I like it.  Thank you.

...

--- a/NEWS

...

+  rm -d now issues an error rather than being silently ignored.


How about a slight change in wording to make clear
that the entire rm command was not being ignored.

   rm's -d now evokes an error;  before, it was silently ignored.


Pushed with that change.

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org





bug#7042: df --help does not show `-m' option

2010-09-17 Thread Andreas Schwab
Pádraig Brady p...@draigbrady.com writes:

 On 16/09/10 23:34, Paul Eggert wrote:
 If we're going to make incompatible changes, I suggest that
 we solve the problem once and for all, by having df choose
 the default blocksize dynamically, based on the size of the
 output line describing the smallest disk.  For example, where
 df currently outputs this:
 
 Filesystem   1K-blocks  Used Available Use% Mounted on
 /dev/sda111620338002   1437021 11618900981   1% /r/opt
 /dev/sda2 20971520   1335871  19635650   7% /home/eggert
 
 df would notice that the smallest file system is between 1GB and 1TB,
 so it would default to 1 GB blocks, as follows:
 
 Filesystem  1GB-blocks  Used Available Use% Mounted on
 /dev/sda1  11900GB   2GB   11898GB   1% /r/opt
 /dev/sda2 22GB   2GB  21GB   7% /home/eggert
 

 That would break lots of scripts I'd say
 (they should use -P, but many don't).

You could use `df -Bauto' for that.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.





bug#7057: Use of JOIN with tab as delimiter

2010-09-17 Thread Magerman, Tom
I would like to use JOIN on tab delimited files in a Windows console window 
(with GNUwin32 CoreUtils), but I'm not able to specify tab as delimiter (-t 
switch).

With the default settings, all tabs are replaced by spaces in my output file.

Any solution for this problem?

Kind regards,
Tom Magerman


bug#7057: Use of JOIN with tab as delimiter

2010-09-17 Thread Eric Blake

On 09/17/2010 12:22 PM, Magerman, Tom wrote:

I would like to use JOIN on tab delimited files in a Windows console window 
(with GNUwin32 CoreUtils), but I'm not able to specify tab as delimiter (-t 
switch).

With the default settings, all tabs are replaced by spaces in my output file.

Any solution for this problem?


What have you tried (that is, show us the command line you typed)?  Are 
you sure you are quoting tab correctly for the shell you are using? 
Based on your comment about a Windows console window, I'm assuming you 
are using cmd (rather than a more traditional Unix-y shell like sh) as 
your shell, you are probably more likely to get a good answer from the 
GNUwin32 folks rather than here, since most readers of this list don't 
use cmd.  Might I suggest instead trying the cygwin environment, where 
bash is pre-built for Windows, and which has traditional Unix quoting 
and is thus something that more readers of this list can help you with.


--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org





bug#7061: loop on touch (fdutimens)

2010-09-17 Thread C de-Avillez
Hello,

I just built  ran a quick test on coreutils GIT. I received a SEGV on
touch, and ran it under GDB.

Looks like a loop.

Cheers,

cer...@xango2:/build/buildd/coreutils$ gdb --args src/touch test
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /src/buildd/coreutils/src/touch...done.
(gdb) set pagination off
(gdb) r
Starting program: /src/buildd/coreutils/src/touch test
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:193
193   if (dup2 (fd, fd) != fd)
(gdb) bt 3 full
#0  0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:193
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = 0
st = error reading variable st (Cannot access memory at address 
0x7f5fef70)
#1  0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, 
st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 
0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, 
st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}}
#2  0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, 
st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 
0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, 
st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}}
(More stack frames follow...)
(gdb) bt -5 full
#38527 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 8589924528, tv_nsec = 0}, {tv_sec = 0, 
tv_nsec = 4197073}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 4197129, st_ino = 140737354130624, st_nlink = 
140737488345056, st_mode = 4160562656, st_uid = 32767, st_gid = 4294957064, 
__pad0 = 32767, st_rdev = 140737354129768, st_size = 255564379, st_blksize = 
140737351936210, st_blocks = 0, st_atim = {tv_sec = 140737353950688, tv_nsec = 
140733193388033}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim = {tv_sec = 
140737354129768, tv_nsec = 0}, __unused = {140737353950688, 1, 0}}
#38528 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 5, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
140737351981093}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 29848917, st_ino = 2, st_nlink = 140737349750208, 
st_mode = 0, st_uid = 0, st_gid = 4152746968, __pad0 = 32767, st_rdev = 
140737354115432, st_size = 0, st_blksize = 4294967295, st_blocks = 24, st_atim 
= {tv_sec = 1, tv_nsec = 6336552}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim 
= {tv_sec = 0, tv_nsec = 0}, __unused = {140737351953297, 1, 0}}
#38529 0x004024e2 in fdutimensat (fd=0, dir=-100, file=0x7fffde74 
test, ts=0x0, atflag=0) at fdutimensat.c:48
result = 1
#38530 0x00401f21 in touch (argc=2, argv=0x7fffdad8) at touch.c:166
ok = value optimized out
fd = 0
open_errno = 0
t = 0x77929f97
#38531 main (argc=2, argv=0x7fffdad8) at touch.c:432
c = value optimized out
date_set = value optimized out
ok = true
flex_date = value optimized out
(gdb) list
188   if (fd  0)
189 {
190   errno = EBADF;
191   return -1;
192 }
193   if (dup2 (fd, fd) != fd)
194 return -1;
195 }
196
197   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
(gdb) 


cer...@xango2:/build/buildd/coreutils$ src/touch --version
touch (GNU coreutils) 8.5.154-2dd21
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change 

bug#7061: loop on touch (fdutimens)

2010-09-17 Thread Paul Eggert
On 09/17/2010 05:49 PM, C de-Avillez wrote:

 I just built  ran a quick test on coreutils GIT. I received a SEGV on
 touch, and ran it under GDB.

I don't observe the problem.  I just now grabbed a fresh copy of coreutils.
I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64.

My guess is that you are running coreutils with a slightly out-of-date
gnulib, or vice versa.  You need to have either both of the following patches, 
or
neither of them.

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821





bug#7061: loop on touch (fdutimens)

2010-09-17 Thread C de-Avillez
On Fri, 17 Sep 2010 19:03:30 -0700
Paul Eggert egg...@cs.ucla.edu wrote:

 On 09/17/2010 05:49 PM, C de-Avillez wrote:
 
  I just built  ran a quick test on coreutils GIT. I received a
  SEGV on touch, and ran it under GDB.
 
 I don't observe the problem.  I just now grabbed a fresh copy of
 coreutils. I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64.

I am running it on Ubuntu Maverick (soon to-be 10.10). I do not have
another Linux distro to test right now, but I will build a 10.04 on
KVM.

 My guess is that you are running coreutils with a slightly
 out-of-date gnulib, or vice versa.  You need to have either both of
 the following patches, or neither of them.
 
 http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2
 
 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821

Both are applied on my git copy. Hum. I will go and redo it from a
fresh git copy.

Thanks, Paul. I will post what I find.

-- 
C de-Avillez
IRC: hggdh

This email (and any attachments) is digitally signed using GNUpg
(http://gnupg.org). The public key is available at http://pgp.mit.edu.
The key Id is 0xD3133E56.


signature.asc
Description: PGP signature