Tweak cmake/autotools so they produce the same output for POTFILES.in

This commit is contained in:
Geert Janssens
2017-08-03 12:02:49 +02:00
parent 96642c608f
commit 16b98cc5a4
5 changed files with 42 additions and 24 deletions

View File

@@ -1,2 +1,2 @@
SET_DIST_LIST(util_DIST gnc-vcs-info guile.c CMakeLists.txt)
SET_DIST_LIST(util_DIST elegant-sort.pl gnc-vcs-info guile.c CMakeLists.txt)

27
util/elegant-sort.pl Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/perl -w
# -*- perl -*-
#
# Sort filenames in POTFILES.in in a consistent way
# This reduces the amount of clutter in our version manangement system
# 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;