add authors-to-cvsimport.pl script
Helpful when creating a git-svn clone of the OMPI repository. Reviewed by jsquyres@ cmr:v1.7:reviewer=jsquyres This commit was SVN r28825.
Этот коммит содержится в:
родитель
e768b3c8c4
Коммит
94977f9501
46
contrib/authors-to-cvsimport.pl
Исполняемый файл
46
contrib/authors-to-cvsimport.pl
Исполняемый файл
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Feed the AUTHORS file to this script either on stdin or as an argument to the
|
||||
# script. It will emit a cvsimport-formatted file which is suitable for
|
||||
# feeding to 'git-svn' or other tools.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $EMAIL_DOMAIN = 'open-mpi-git-mirror.example.com';
|
||||
my $line;
|
||||
|
||||
# discard preamble
|
||||
do {
|
||||
$line = <>;
|
||||
} until ($line =~ m/^Username\s+Name\s+Affiliation/);
|
||||
|
||||
unless (($line = <>) =~ m/^(-+ )(-+ )(-+)$/) {
|
||||
die "expected properly formatted table header, stopped";
|
||||
}
|
||||
my $login_len = length($1);
|
||||
my $name_len = length($2);
|
||||
my $affil_len = length($3);
|
||||
|
||||
while ($line = <>) {
|
||||
chomp($line);
|
||||
last if ($line =~ m/^\s*$/);
|
||||
|
||||
# 4th arg consumes the substring from $line as we go.
|
||||
my $login = substr($line, 0, $login_len, "");
|
||||
my $name = substr($line, 0, $name_len, "");
|
||||
my $affil = substr($line, 0, $affil_len, "");
|
||||
|
||||
# strip trailing whitespace
|
||||
$login =~ s/\s*$//;
|
||||
$name =~ s/\s*$//;
|
||||
$affil =~ s/\s*$//;
|
||||
|
||||
printf("%s = %s <%s\@$EMAIL_DOMAIN>\n", $login, $name, $login);
|
||||
}
|
||||
|
||||
printf("%s = %s <%s\@$EMAIL_DOMAIN>\n", '(no author)', 'Unknown', 'unknown');
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user