]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a script for finding all files using native eol style in svn.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Jul 2010 16:18:48 +0000 (16:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Jul 2010 16:18:48 +0000 (16:18 +0000)
This is a companion script for build/tools/git-make-release but can also be
useful independently.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/tools/svn-find-native-eols.pl [new file with mode: 0644]

diff --git a/build/tools/svn-find-native-eols.pl b/build/tools/svn-find-native-eols.pl
new file mode 100644 (file)
index 0000000..fefe956
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# This script must be ran from svn checkout and will produce the list of all
+# files using native svn:eol-style on output. It's used as a helper for
+# distribution creation as this is also the list of files which need to have
+# their line endings converted for the use on the platform other than the
+# current one.
+#
+# Notice that the script requires Perl 5.10 (which could be easily avoided but
+# as this is for my personal use mostly so far, I didn't bother) and Perl svn
+# bindings.
+use 5.10.0;
+use strict;
+use warnings;
+use SVN::Client;
+
+my $ctx = SVN::Client->new
+    or die "Failed to create svn context, do you have svn auth stored?\n";
+
+# For testing purposes a single parameter may be specified to restrict the list
+# of files with native EOLs to just this directory (recursively) or even a
+# single file. In normal use no parameters should be given.
+my $path = $ARGV[0] // '';
+my $props = $ctx->proplist($path, undef, 1)
+    or die "Failed to list properties for $path.\n";
+
+foreach my $prop (@$props) {
+    my $eol = ${$prop->prop_hash()}{'svn:eol-style'};
+    if ( defined $eol && ($eol eq 'native') ) {
+        say $prop->node_name();
+    }
+}