From fa699cbaaf217af186cd04dd10d6ec67c8667136 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 17 Jul 2013 12:57:07 +0000 Subject: [PATCH] Make it possible to use svn-find-native-eols script without svn checkout. This should make it simpler to use it for other people. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/tools/svn-find-native-eols.pl | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) mode change 100644 => 100755 build/tools/svn-find-native-eols.pl diff --git a/build/tools/svn-find-native-eols.pl b/build/tools/svn-find-native-eols.pl old mode 100644 new mode 100755 index fefe956683..d9a2d9110c --- a/build/tools/svn-find-native-eols.pl +++ b/build/tools/svn-find-native-eols.pl @@ -1,10 +1,10 @@ #!/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. +# This script produces the list of all files using native svn:eol-style. +# +# 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 @@ -14,19 +14,23 @@ use strict; use warnings; use SVN::Client; +# Normally we get the list directly from the server but this is slow, +# so if you already have an (up to date!) svn checkout, you can also +# pass a path to it here, the script will work much faster then. +my $root = $ARGV[0] // 'https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk'; + 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"; +my $props = $ctx->proplist($root, undef, 1) + or die "Failed to list properties for files under $root.\n"; foreach my $prop (@$props) { my $eol = ${$prop->prop_hash()}{'svn:eol-style'}; if ( defined $eol && ($eol eq 'native') ) { - say $prop->node_name(); + my $rel = $prop->node_name(); + substr($rel, 0, length($root) + 1, ''); # +1 for leading slash + + say $rel; } }