# HG changeset patch # User Akim Demaille # Date 1337759268 -7200 # Node ID d252b31de6ab456f79d408b96b3016e88e30bfd2 # Parent 4d9281e5299823781cdb9c480276f6dd9f99f194 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 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/build-aux/announce-gen b/build-aux/announce-gen --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -103,13 +103,13 @@ 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;