source: XIOS/tools/FCM/examples/sbin/fcm-install-svn-hook @ 1520

Last change on this file since 1520 was 81, checked in by ymipsl, 12 years ago

ajout FCM 1.5

File size: 2.1 KB
Line 
1#!/usr/bin/perl
2# ------------------------------------------------------------------------------
3# (C) Crown copyright Met Office. All rights reserved.
4# For further details please refer to the file COPYRIGHT.txt
5# which you should have received as part of this distribution.
6# ------------------------------------------------------------------------------
7
8use strict;
9use warnings;
10
11use FindBin;
12use lib "$FindBin::Bin/../lib";
13use FCM::Admin::System qw{
14    filter_projects
15    get_projects_from_svn_live
16    install_svn_hook
17};
18use FCM::Admin::Util qw{option2config};
19use Getopt::Long qw{GetOptions};
20use Pod::Usage qw{pod2usage};
21
22main();
23
24sub main {
25    my %option;
26    my $result = GetOptions(
27        \%option,
28        q{help|usage|h},
29        q{svn-hook-dir=s},
30        q{svn-live-dir=s},
31        q{svn-project-suffix=s},
32    );
33    if (!$result) {
34        pod2usage(1);
35    }
36    if (exists($option{help})) {
37        pod2usage(q{-verbose} => 1);
38    }
39    option2config(\%option);
40    my @projects = filter_projects([get_projects_from_svn_live()], \@ARGV);
41    for my $project (@projects) {
42        install_svn_hook($project);
43    }
44}
45
46__END__
47
48=head1 NAME
49
50fcm-install-svn-hook
51
52=head1 SYNOPSIS
53
54    fcm-install-svn-hook [OPTIONS] [PROJECT ...]
55
56=head1 OPTIONS
57
58=over 4
59
60=item --help, -h, --usage
61
62Prints help and exits.
63
64=item --svn-hook-dir=DIR
65
66Specifies the root location of the directory containing the source files of the
67hook scripts. See L<FCM::Admin::Config|FCM::Admin::Config> for the current
68default.
69
70=item --svn-live-dir=DIR
71
72Specifies the root location of the live directory. See
73L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
74
75=item --svn-project-suffix=NAME
76
77Specifies the suffix added to the project name. The default is "_svn".
78
79=back
80
81=head1 ARGUMENTS
82
83=over 4
84
85=item PROJECT
86
87Specifies one or more project requiring hooks scripts to be installed. If no
88project is specified, the program install the hook scripts to all projects in
89the live directory.
90
91=back
92
93=head1 DESCRIPTION
94
95This program install hook scripts for Subversion repositories in the live
96directory.
97
98=head1 COPYRIGHT
99
100E<169> Crown copyright Met Office. All rights reserved.
101
102=cut
Note: See TracBrowser for help on using the repository browser.