]> git.saurik.com Git - wxWidgets.git/blob - build/tools/svn-find-native-eols.pl
Add a test for eol-native file existence in the release script.
[wxWidgets.git] / build / tools / svn-find-native-eols.pl
1 #!/usr/bin/perl
2 #
3 # This script produces the list of all files using native svn:eol-style.
4 #
5 # It's used as a helper for distribution creation as this is also the
6 # list of files which need to have their line endings converted for
7 # the use on the platform other than the current one.
8 #
9 # Notice that the script requires Perl 5.10 (which could be easily avoided but
10 # as this is for my personal use mostly so far, I didn't bother) and Perl svn
11 # bindings.
12 use 5.10.0;
13 use strict;
14 use warnings;
15 use SVN::Client;
16
17 # Normally we get the list directly from the server but this is slow,
18 # so if you already have an (up to date!) svn checkout, you can also
19 # pass a path to it here, the script will work much faster then.
20 my $root = $ARGV[0] // 'https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk';
21
22 my $ctx = SVN::Client->new
23 or die "Failed to create svn context, do you have svn auth stored?\n";
24
25 my $props = $ctx->proplist($root, undef, 1)
26 or die "Failed to list properties for files under $root.\n";
27
28 foreach my $prop (@$props) {
29 my $eol = ${$prop->prop_hash()}{'svn:eol-style'};
30 if ( defined $eol && ($eol eq 'native') ) {
31 my $rel = $prop->node_name();
32 substr($rel, 0, length($root) + 1, ''); # +1 for leading slash
33
34 say $rel;
35 }
36 }