You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/05/22 21:21:13 UTC
svn commit: r1485350 - in /subversion/trunk/contrib/hook-scripts:
check-mime-type.pl svn-keyword-check.pl
Author: danielsh
Date: Wed May 22 19:21:13 2013
New Revision: 1485350
URL: http://svn.apache.org/r1485350
Log:
* contrib/hook-scripts/check-mime-type.pl
(): Add an explicit "end of arguments" flag.
(safe_read_from_pipe): Add an explicit third argument.
* contrib/hook-scripts/svn-keyword-check.pl: Same.
Modified:
subversion/trunk/contrib/hook-scripts/check-mime-type.pl
subversion/trunk/contrib/hook-scripts/svn-keyword-check.pl
Modified: subversion/trunk/contrib/hook-scripts/check-mime-type.pl
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/hook-scripts/check-mime-type.pl?rev=1485350&r1=1485349&r2=1485350&view=diff
==============================================================================
--- subversion/trunk/contrib/hook-scripts/check-mime-type.pl (original)
+++ subversion/trunk/contrib/hook-scripts/check-mime-type.pl Wed May 22 19:21:13 2013
@@ -120,7 +120,7 @@ foreach my $path ( @files_added )
# Parse the complete list of property values of the file $path to extract
# the mime-type and eol-style
foreach my $prop (&read_from_process($svnlook, 'proplist', $repos, '-t',
- $txn, '--verbose', $path))
+ $txn, '--verbose', '--', $path))
{
if ($prop =~ /^\s*svn:mime-type : (\S+)/)
{
@@ -187,7 +187,7 @@ sub safe_read_from_pipe
croak "$0: safe_read_from_pipe passed no arguments.\n";
}
print "Running @_\n";
- my $pid = open(SAFE_READ, '-|');
+ my $pid = open(SAFE_READ, '-|', @_);
unless (defined $pid)
{
die "$0: cannot fork: $!\n";
Modified: subversion/trunk/contrib/hook-scripts/svn-keyword-check.pl
URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/hook-scripts/svn-keyword-check.pl?rev=1485350&r1=1485349&r2=1485350&view=diff
==============================================================================
--- subversion/trunk/contrib/hook-scripts/svn-keyword-check.pl (original)
+++ subversion/trunk/contrib/hook-scripts/svn-keyword-check.pl Wed May 22 19:21:13 2013
@@ -141,7 +141,7 @@ sub check {
return 1;
} else {
my @keywords = get_svnkeywords($file);
- my $fh = _pipe("$svnlook cat $flag $value $repos $file");
+ my $fh = _pipe($svnlook, qw/cat/, $flag, $value, $repos, '--', $file);
while (my $line = <$fh>) {
foreach my $keyword (@keywords) {
if ($line =~ m/$keyword/) {
@@ -168,7 +168,7 @@ sub file_is_binary {
return 0;
}
if (has_svn_property($file, "svn:mime-type")) {
- my ($mimetype) = read_from_process("$svnlook propget $flag $value $repos svn:mime-type $file");
+ my ($mimetype) = read_from_process($svnlook, qw/propget/, $flag, $value, $repos, 'svn:mime-type', '--', $file);
chomp($mimetype);
$mimetype =~ s/^\s*(.*)/$1/;
if ($mimetype =~ m/^text\//) {
@@ -186,7 +186,7 @@ sub file_is_binary {
# Return a list of svn:keywords on a file
sub get_svnkeywords {
my $file = shift;
- my @lines = read_from_process("$svnlook propget $flag $value $repos svn:keywords $file");
+ my @lines = read_from_process($svnlook, qw/propget/, $flag, $value, $repos, 'svn:keywords', '--', $file);
my @returnlines;
foreach my $line (@lines) {
$line =~ s/\s+/ /;
@@ -199,7 +199,7 @@ sub get_svnkeywords {
sub has_svn_property {
my $file = shift;
my $keyword = shift;
- my @proplist = read_from_process("$svnlook proplist $flag $value $repos $file");
+ my @proplist = read_from_process($svnlook, qw/proplist/, $flag, $value, $repos, '--', $file);
foreach my $prop (@proplist) {
chomp($prop);
if ($prop =~ m/\b$keyword\b/) {
@@ -241,7 +241,7 @@ sub safe_read_from_pipe {
# Return the filehandle as a glob so we can loop over it elsewhere.
sub _pipe {
local *SAFE_READ;
- my $pid = open(SAFE_READ, '-|');
+ my $pid = open(SAFE_READ, '-|', @_);
unless (defined $pid) {
die "$0: cannot fork: $!\n";
}