source: LMDZ6/branches/Amaury_dev/tools/fcm/sbin/fcm-add-svn-repos @ 5110

Last change on this file since 5110 was 5095, checked in by abarral, 4 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/usr/bin/perl
2# ------------------------------------------------------------------------------
3# Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
4#
5# This file is part of FCM, tools for managing and building source code.
6#
7# FCM is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# FCM is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with FCM. If not, see <http://www.gnu.org/licenses/>.
19# ------------------------------------------------------------------------------
20
21use strict;
22use warnings;
23
24use FindBin;
25use lib "$FindBin::Bin/../lib";
26use FCM::Admin::System qw{add_svn_repository};
27use FCM::Admin::Util qw{option2config};
28use Getopt::Long qw{GetOptions};
29use Pod::Usage qw{pod2usage};
30
31main();
32
33sub main {
34    my %option;
35    my $result = GetOptions(
36        \%option,
37        q{help|usage|h},
38        q{svn-live-dir=s},
39        q{svn-project-suffix=s},
40    );
41    if (!$result) {
42        pod2usage(1);
43    }
44    if (exists($option{help})) {
45        pod2usage(q{-verbose} => 1);
46    }
47    option2config(\%option);
48    if (@ARGV != 1) {
49        my $message = sprintf(
50            qq{Expected exactly 1 argument, %d given.}, scalar(@ARGV),
51        );
52        pod2usage({q{-exitval} => 1, q{-message} => $message});
53    }
54    my ($project_name) = @ARGV;
55    add_svn_repository($project_name);
56}
57
58__END__
59=head1 NAME
60
61fcm-add-trac-env
62
63=head1 SYNOPSIS
64
65    fcm-add-svn-repos [OPTIONS] PROJECT
66
67=head1 OPTIONS
68
69=over 4
70
71=item --help, -h, --usage
72
73Prints help and exits.
74
75=item --svn-live-dir=DIR
76
77Specifies the root location of the live directory of Subversion repositories.
78See L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
79
80=item --svn-project-suffix=NAME
81
82Specifies the suffix added to the project name for Subversion repositories. The
83default is "_svn".
84
85=back
86
87=head1 ARGUMENTS
88
89=over 4
90
91=item PROJECT
92
93Specifies the name of the project to add.
94
95=back
96
97=head1 DESCRIPTION
98
99This program adds a new Subversion repository.
100
101=head1 COPYRIGHT
102
103Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
104
105=cut
Note: See TracBrowser for help on using the repository browser.