2017-08-03 05:02:49 -05:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
# -*- perl -*-
|
|
|
|
#
|
|
|
|
# Sort filenames in POTFILES.in in a consistent way
|
Fix typos for gnuchash/ doc/ bindings/ and misc.
Typos found via `codespell -q 3 -D ~/Projects/codespell/codespell_lib/data/dictionary.txt -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,cas,dragable,gae,iff,iif,mut,nd,numer,startd,stoll`
2019-09-13 19:26:03 -05:00
|
|
|
# This reduces the amount of clutter in our version management system
|
2017-08-03 05:02:49 -05:00
|
|
|
# The files will be sorted
|
|
|
|
# * per directory
|
|
|
|
# * case-insensitive
|
|
|
|
# * ignoring punctuation (-,_,.)
|
|
|
|
#
|
|
|
|
sub sort_func
|
|
|
|
{
|
|
|
|
my $stripped_a = $a;
|
|
|
|
my $stripped_b = $b;
|
|
|
|
$stripped_a =~ s/[-_.]//g;
|
|
|
|
$stripped_b =~ s/[-_.]//g;
|
|
|
|
|
|
|
|
lc ($stripped_a) cmp lc ($stripped_b)
|
|
|
|
||
|
|
|
|
lc ($a) cmp lc ($b)
|
|
|
|
}
|
|
|
|
|
|
|
|
#open my $fh, '<', $ARGV[0];
|
|
|
|
#my @raw_files = <$fh>;
|
|
|
|
my @raw_files = <STDIN>;
|
|
|
|
my @possible_files = sort sort_func @raw_files;
|
|
|
|
print @possible_files;
|