From: Akim Demaille Date: Wed, 23 May 2012 07:47:48 +0000 (+0200) Subject: announce-gen: du -h is more portable than du --human X-Git-Tag: v0.1~650 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=338dd5d4362fdf5fb29b843d4d8a8f845bc750de;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 64900db20..89ed235fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-05-23 Akim Demaille + 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. + +2012-05-23 Akim Demaille + announce-gen: Improve diagnostics. * build-aux/announce-gen: When parsing command line options, prefer "announce-gen: option --release-type requires an argument" diff --git a/build-aux/announce-gen b/build-aux/announce-gen index 4d0b82cb2..ff581fac6 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;