/usr/share/perl5/SVN/Hooks/CheckCapability.pm is in libsvn-hooks-perl 1.34-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | package SVN::Hooks::CheckCapability;
# ABSTRACT: Check the svn client capabilities.
$SVN::Hooks::CheckCapability::VERSION = '1.34';
use strict;
use warnings;
use Carp;
use SVN::Hooks;
use Exporter qw/import/;
my $HOOK = 'CHECK_CAPABILITY';
our @EXPORT = ($HOOK);
my @Capabilities;
sub CHECK_CAPABILITY {
push @Capabilities, @_;
START_COMMIT(\&start_commit);
return 1;
}
sub start_commit {
my ($repo_path, $user, $capabilities, $txt_name) = @_;
$capabilities ||= ''; # pre 1.5 svn clients don't pass the capabilities
# Create a hash to facilitate the checks
my %supported;
@supported{split /:/, $capabilities} = undef;
# Grok which required capabilities are missing
my @missing = grep {! exists $supported{$_}} @Capabilities;
if (@missing) {
croak "$HOOK: Your subversion client does not support the following capabilities:\n\n\t",
join(', ', @missing),
"\n\nPlease, consider upgrading to a newer version of your client.\n";
}
}
1; # End of SVN::Hooks::CheckCapability
__END__
=pod
=encoding UTF-8
=head1 NAME
SVN::Hooks::CheckCapability - Check the svn client capabilities.
=head1 VERSION
version 1.34
=head1 SYNOPSIS
This SVN::Hooks plugin checks if the Subversion client implements the
required capabilities.
It's active in the C<start-commit> hook.
It's configured by the following directive.
=head2 CHECK_CAPABILITY(CAPABILITY...)
This directive enables the checking, causing the commit to abort if it
doesn't comply.
The arguments are a list of capability names. Every capability
specified must be supported by the client in order to the hook to
succeed.
Example:
CHECK_CAPABILITY('mergeinfo');
=for Pod::Coverage start_commit
=head1 AUTHOR
Gustavo L. de M. Chaves <gnustavo@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by CPqD <www.cpqd.com.br>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|