1
1

Remove old/now-useless SVN integration scripts

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2016-11-01 19:25:13 -04:00
родитель c54dc87f71
Коммит 7ccf253063
3 изменённых файлов: 0 добавлений и 319 удалений

1
contrib/git/.gitignore поставляемый
Просмотреть файл

@ -1 +0,0 @@
.svn

Просмотреть файл

@ -1,202 +0,0 @@
#!/usr/bin/env perl
#
# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Dumb script to run through all the svn:ignore's in the tree and
# build build .gitignore files for Git.
use strict;
use Getopt::Long;
use File::Copy;
my $verbose_arg = 0;
# Default to writing .gitignore
my $output_arg = ".gitignore";
my $help_arg = 0;
&Getopt::Long::Configure("bundling");
my $ok = Getopt::Long::GetOptions("verbose|v!" => \$verbose_arg,
"output|o=s" => \$output_arg,
"help|h!" => \$help_arg);
if (!$ok || $help_arg) {
print "
Usage: $0 [-v] [-o output] [-h]\n";
exit($ok);
}
print "Writing to: $output_arg\n"
if ($verbose_arg);
open(OUT, ">$output_arg");
my @globals;
#############################################################################
print "Thinking...\n"
if (!$verbose_arg);
# if we are not in an svn repo, then just concatenate
# the .gitignore_global and any .gitignore_local files
# to make the new .gitignore
if (! -d "./.svn") {
print "Not in an svn repo - creating .gitignore from existing files\n"
if ($verbose_arg);
my @files = qw(.gitignore_global .gitignore_local);
my @git;
while (@files) {
local $_ = shift @files;
if (-f $_) {
open(IN, $_) || die "Can't open $_";
print "Reading $_...\n"
if ($verbose_arg);
while (<IN>) {
chomp;
push(@git, $_);
}
close(IN);
}
}
foreach my $val (@git) {
print OUT "$val\n";
}
} else {
# Put in some specials that we ignore everywhere
@globals = qw/.libs
.deps
.libs
.svn
*.la
*.lo
*.o
*.so
*.a
.dirstamp
*.dSYM
*.S
*.loT
*.orig
*.rej
*.class
*.xcscheme
*.plist
*~
Makefile
Makefile.in
static-components.h
*\\\#/;
unshift(@globals, "# Automatically generated by build-gitignore.pl; edits may be lost!");
# add the globals */
foreach my $val (@globals) {
print OUT "$val\n";
}
# Start at the top level
process(".");
}
close(OUT);
print "Wrote to $output_arg\n"
if ($verbose_arg);
# Done!
exit(0);
#######################################################################
# DFS-oriented recursive directory search
sub process {
my $dir = shift;
my $outdir = $dir;
$outdir =~ s/^\.\///;
# Look at the svn:ignore property for this directory
my $svn_ignore = `svn pg svn:ignore $dir 2> /dev/null`;
# If svn failed, bail on this directory.
return
if ($? != 0);
chomp($svn_ignore);
if ($svn_ignore ne "") {
print "Found svn:ignore in $dir\n"
if ($verbose_arg);
my @git;
# See if there's an .gitignore_local file. If so, add its
# contents to the end.
if (-f "$dir/.gitignore_local") {
print "Reading $dir/.gitignore_local...\n"
if ($verbose_arg);
open(IN, "$dir/.gitignore_local") || die "Can't open .gitignore_local";
while (<IN>) {
chomp;
push(@git, $_);
}
close(IN);
}
# Now read the svn:ignore value
foreach my $line (split(/\n/, $svn_ignore)) {
chomp($line);
$line =~ s/^\.\///;
next
if ($line eq "");
# Ensure not to ignore special git files
next
if ($line eq ".gitignore" || $line eq ".gitignore_local" ||
$line eq ".git" || $line eq ".svn");
# We're globally ignoring some specials already; we can
# skip those
my $skip = 0;
foreach my $g (@globals) {
if ($g eq $line) {
$skip = 1;
last;
}
}
next
if ($skip);
push(@git, "$line");
}
# Write out a new .gitignore file
foreach my $val (@git) {
if ($outdir eq ".") {
print OUT "$val\n";
} else {
print OUT "$outdir/$val\n";
}
}
}
# Now find subdirectories in this directory
my @entries;
opendir(DIR, $dir) || die "Cannot open directory \"$dir\" for reading: $!";
@entries = sort(readdir(DIR));
closedir DIR;
foreach my $e (@entries) {
# Skip special directories and sym links
next
if ($e eq "." || $e eq ".." || $e eq ".svn" || $e eq ".git" ||
-l "$dir/$e");
# If it's a directory, analyze it
process("$dir/$e")
if (-d "$dir/$e");
}
}

Просмотреть файл

@ -1,116 +0,0 @@
#!/bin/bash -x
svn_url="http://svn.open-mpi.org/svn/ompi/trunk"
# Use newer git (1.8.3+) to convert from svn2git which contains many conversion fixes
GIT18="/scrap/OMPI_REPO/GIT-1.8.3.4/bin/git"
# 1st copy location after svn->git conversion
# This repo should be cloned from SVN manually like this:
# $GIT18 svn clone $1 --no-metadata -A ../authors.txt -t tags -b branches --tags=tags/v1.0-series --tags=tags/v1.1-series --tags=tags/v1.2-series --tags=tags/v1.3-series --tags=tags/v1.4-series --tags=tags/v1.5-series --tags=tags/v1.6-series --tags=tags/v1.7-series -T trunk . | tee > $logfile
temp_repository=/scrap/OMPI_REPO/GIT/ompi-temp
# branches to mirror into destination git repo
BRANCHES='master v1.7 v1.6'
# FS path to destination git repo
DEST_REPO='/hpc/home/git/ompi-vendor.git'
# location to generate Authors files from svn to git format
path2author='/scrap/OMPI_REPO/GIT'
logfile=/tmp/git-svn-update.$$.log
admin_email="git-mirror-admin"
local_fs_git_mirror=/hpc/home/git
# github URL with username/passwd
github_auth_file=$(dirname $0)/github_url.txt
if [ ! -f $github_auth_file ]; then
echo ERROR: unable to fine URL with github mirror
exit 1
fi
github_url=$(cat $github_auth_file)
###############################################################################
doit() {
cmd="$*"
eval $cmd >> $logfile 2>&1
status=$?
if test "$status" != "0"; then
echo "Git SVN update failed. Log:"
tail -20 $logfile | mail -s "OMPI replication failed: $cmd" $admin_email
cat $logfile
exit $status
fi
}
function create_authors(){
pushd .
mv -f $path2author/authors.txt $path2author/authors.txt.backup
svn cat ${svn_url}/contrib/authors-to-cvsimport.pl > authors-to-cvsimport.pl
svn cat ${svn_url}/AUTHORS > AUTHORS
chmod 755 authors-to-cvsimport.pl
./authors-to-cvsimport.pl AUTHORS > $path2author/authors.txt
popd
}
###############################################################################
force=''
if [ "$1" = "--force" ] || [ "$1" = "-f" ] ; then
echo "WARNING!!! Force-pushing to git repositories, may result in rewinding!"
force='--force'
fi
rm -f $logfile
touch $logfile
cd $temp_repository
create_authors
doit $GIT18 svn fetch --fetch-all
doit $GIT18 checkout master
for i in `$GIT18 branch|grep -v trunk|grep -v master|grep -v '@'`; do
doit $GIT18 checkout ${i}
doit $GIT18 merge remotes/${i}
done
doit $GIT18 checkout master
doit $GIT18 svn fetch
doit $GIT18 merge remotes/trunk
# GitHub mirror
doit $GIT18 push $force $github_url '*:*'
doit $GIT18 push $force $github_url :trunk
# Local FS git mirror, ompi.git and ompi-replication.git should be cloned before running this script
if [ -d $local_fs_git_mirror ]; then
for repo in ompi.git ompi-replication.git; do
if [ -d $local_fs_git_mirror/$repo ]; then
doit $GIT18 push $force $local_fs_git_mirror/$repo '*:*'
doit $GIT18 push $force $local_fs_git_mirror/$repo :trunk
fi
done
# Repo ompi-vendor
doit sudo chown -R $USER $DEST_REPO
cd $temp_repository
for repon in $BRANCHES; do
doit $GIT18 push $force $DEST_REPO $repon:$repon
done
fi
rm -f $logfile
exit 0