diff options
author | Akim Demaille <akim@lrde.epita.fr> | 2012-05-23 09:47:48 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-05-23 11:36:18 +0200 |
commit | 338dd5d4362fdf5fb29b843d4d8a8f845bc750de (patch) | |
tree | 3aba36a640eb15aca2bfbb71da2fb014ed6810ed /build-aux/announce-gen | |
parent | 14e732b59e0bd238524558b36cac3a2b7400c590 (diff) | |
download | gnulib-338dd5d4362fdf5fb29b843d4d8a8f845bc750de.tar.gz |
announce-gen: du -h is more portable than du --human
* build-aux/announce-gen (sizes): Invoke du with -h instead
of --human. Accept leading white space in its output.
These changes are required to accommodate OS/X's du.
Diffstat (limited to 'build-aux/announce-gen')
-rwxr-xr-x | build-aux/announce-gen | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build-aux/announce-gen b/build-aux/announce-gen index 4d0b82cb2d..ff581fac67 100755 --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -103,13 +103,13 @@ sub sizes (@) my %res; foreach my $f (@file) { - my $cmd = "du --human $f"; + my $cmd = "du -h $f"; my $t = `$cmd`; # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS $@ and (warn "command failed: '$cmd'\n"), $fail = 1; chomp $t; - $t =~ s/^([\d.]+[MkK]).*/${1}B/; + $t =~ s/^\s*([\d.]+[MkK]).*/${1}B/; $res{$f} = $t; } return $fail ? undef : %res; |