summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-08-17 17:12:30 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-12-25 08:07:16 +0000
commit2e134da46c317669e226000b14551727bd3477d7 (patch)
tree9ac0b13553ec2b917b74473b0367e939eaa44589
parentc3e404fffd954050ab30d1da92700dc37e1d2a7b (diff)
don't use POD, to restore msysgit perl compatibility
Change-Id: I360a6d5246e33dcf3f72bc83f2790905af8c1463 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rwxr-xr-xinit-repository195
1 files changed, 83 insertions, 112 deletions
diff --git a/init-repository b/init-repository
index 4f017318..f0407f63 100755
--- a/init-repository
+++ b/init-repository
@@ -39,149 +39,120 @@ use warnings;
package Qt::InitRepository;
-=head1 NAME
-
-init-repository - initialize the Qt5 repository and all submodules
-
-=head1 SYNOPSIS
-
- ./init-repository [options]
-
-This script may be run after an initial `git clone' of Qt5 in order to check
-out all submodules. It fetches them from canonical URLs inferred from the
-clone's origin.
-
-
-=head1 OPTIONS
-
-B<Global options:>
-
-=over
-
-=item --force, -f
-
-Force initialization (even if the submodules are already checked out).
-
-
-=item --force-hooks
-
-Force initialization of hooks (even if there are already hooks in checked out
-submodules).
-
-
-=item --quiet, -q
-
-Be quiet. Will exit cleanly if the repository is already initialized.
-
-=back
-
-
-B<Module options:>
-
-=over
-
-=item --module-subset=<module1>,<module2>...
-
-Only initialize the specified subset of modules given as the argument. Specified
-modules must already exist in .gitmodules.
-The string "all" results in cloning all known modules. The default is the set of
-maintained modules.
-Module names may be prefixed with a dash to exclude them from a bigger set.
-
-=item --no-update
-
-Skip the `git submodule update' command.
-
-=item --branch
-
-Instead of checking out specific SHA1s, check out the submodule branches that
-correspond with the current supermodule commit.
-By default, this option will cause local commits in the submodules to be rebased.
-With --no-update, the branches will be checked out, but their heads will not move.
-
-=item --ignore-submodules
-
-Set git config to ignore submodules by default when doing operations on the
-qt5 repo, such as `pull', `fetch', `diff' etc.
-
-After using this option, pass `--ignore-submodules=none' to git to override
-it as needed.
-
-=back
-
+sub printUsage($)
+{
+ my ($ex) = @_;
-B<Repository options:>
+ print <<EOF ;
+Usage:
+ ./init-repository [options]
-=over
+ This script may be run after an initial `git clone' of Qt5 in order to
+ check out all submodules. It fetches them from canonical URLs inferred
+ from the clone's origin.
-=item --berlin
+Options:
+ Global options:
-Switch to internal URLs and make use of the Berlin git mirrors.
-(Implies `--mirror').
+ --force, -f
+ Force initialization (even if the submodules are already checked
+ out).
-=item --oslo
+ --force-hooks
+ Force initialization of hooks (even if there are already hooks in
+ checked out submodules).
-Switch to internal URLs and make use of the Oslo git mirrors.
-(Implies `--mirror').
+ --quiet, -q
+ Be quiet. Will exit cleanly if the repository is already
+ initialized.
+ Module options:
-=item --codereview-username <Gerrit/JIRA username>
+ --module-subset=<module1>,<module2>...
+ Only initialize the specified subset of modules given as the
+ argument. Specified modules must already exist in .gitmodules. The
+ string "all" results in cloning all known modules. The default is
+ the set of maintained modules. Module names may be prefixed with a
+ dash to exclude them from a bigger set.
-Specify the user name for the (potentially) writable `gerrit' remote
-for each module, for use with the Gerrit code review tool.
+ --no-update
+ Skip the `git submodule update' command.
-If this option is omitted, the gerrit remote is created without a username
-and port number, and thus relies on a correct SSH configuration.
+ --branch
+ Instead of checking out specific SHA1s, check out the submodule
+ branches that correspond with the current supermodule commit. By
+ default, this option will cause local commits in the submodules to
+ be rebased. With --no-update, the branches will be checked out, but
+ their heads will not move.
+ --ignore-submodules
+ Set git config to ignore submodules by default when doing operations
+ on the qt5 repo, such as `pull', `fetch', `diff' etc.
-=item --alternates <path to other Qt5 repo>
+ After using this option, pass `--ignore-submodules=none' to git to
+ override it as needed.
-Adds alternates for each submodule to another full qt5 checkout. This makes
-this qt5 checkout very small, as it will use the object store of the
-alternates before unique objects are stored in its own object store.
+ Repository options:
-This option has no effect when using `--no-update'.
+ --berlin
+ Switch to internal URLs and make use of the Berlin git mirrors.
+ (Implies `--mirror').
-B<NOTE:> This will make this repo dependent on the alternate, which is
-potentially dangerous! The dependency can be broken by also using
-the `--copy-objects' option, or by running C<git repack -a> in each
-submodule, where required. Please read the note about the `--shared' option
-in the documentation of `git clone' for more information.
+ --oslo
+ Switch to internal URLs and make use of the Oslo git mirrors.
+ (Implies `--mirror').
+ --codereview-username <Gerrit/JIRA username>
+ Specify the user name for the (potentially) writable `gerrit' remote
+ for each module, for use with the Gerrit code review tool.
-=item --copy-objects
+ If this option is omitted, the gerrit remote is created without a
+ username and port number, and thus relies on a correct SSH
+ configuration.
-When `--alternates' is used, automatically do a C<git repack -a> in each
-submodule after cloning, to ensure that the repositories are independent
-from the source used as a reference for cloning.
+ --alternates <path to other Qt5 repo>
+ Adds alternates for each submodule to another full qt5 checkout.
+ This makes this qt5 checkout very small, as it will use the object
+ store of the alternates before unique objects are stored in its own
+ object store.
-Note that this negates the disk usage benefits gained from the use of
-`--alternates'.
+ This option has no effect when using `--no-update'.
+ NOTE: This will make this repo dependent on the alternate, which is
+ potentially dangerous! The dependency can be broken by also using
+ the `--copy-objects' option, or by running "git repack -a" in each
+ submodule, where required. Please read the note about the `--shared'
+ option in the documentation of `git clone' for more information.
-=item --mirror <url-base>
+ --copy-objects
+ When `--alternates' is used, automatically do a "git repack -a" in
+ each submodule after cloning, to ensure that the repositories are
+ independent from the source used as a reference for cloning.
-Uses <url-base> as the base URL for submodule git mirrors.
+ Note that this negates the disk usage benefits gained from the use
+ of `--alternates'.
-For example:
+ --mirror <url-base>
+ Uses <url-base> as the base URL for submodule git mirrors.
- --mirror user@machine:/foo/bar/
+ For example:
-...will use the following as a mirror for qtbase:
+ --mirror user\@machine:/foo/bar/
- user@machine:/foo/bar/qt/qtbase.git
+ ...will use the following as a mirror for qtbase:
-The mirror is permitted to contain a subset of the submodules; any
-missing modules will fall back to the canonical URLs.
+ user\@machine:/foo/bar/qt/qtbase.git
-=back
+ The mirror is permitted to contain a subset of the submodules; any
+ missing modules will fall back to the canonical URLs.
-=cut
+EOF
+ exit($ex);
+}
use Carp qw( confess );
use English qw( -no_match_vars );
use Getopt::Long qw( GetOptions );
-use Pod::Usage qw( pod2usage );
use Cwd qw( getcwd );
my $GERRIT_SSH_BASE
@@ -250,7 +221,7 @@ sub parse_arguments
'update!' => \$self->{qw{ update }},
'module-subset=s' => \$self->{qw{ module-subset }},
- 'help|?' => sub { pod2usage(1); },
+ 'help|?' => sub { printUsage(1); },
'berlin' => sub {
$self->{'mirror-url'} = $BER_MIRROR_URL_BASE;
@@ -258,7 +229,7 @@ sub parse_arguments
'oslo' => sub {
$self->{'mirror-url'} = $OSLO_MIRROR_URL_BASE;
},
- ) || pod2usage(2);
+ ) || printUsage(2);
# Replace any double trailing slashes from end of mirror
$self->{'mirror-url'} =~ s{//+$}{/};