Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cvsimport: cleanup temporary cvsps file
author
Martin Langhoff
<martin@catalyst.net.nz>
Mon, 8 Jan 2007 08:08:46 +0000
(21:08 +1300)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 8 Jan 2007 11:01:35 +0000
(
03:01
-0800)
It is bad manners to leave these sizable files
around when we are done with them.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
eec8496
)
diff --git
a/git-cvsimport.perl
b/git-cvsimport.perl
index a86ee3cb18ce2d182608c4ce360d4b98844d3bad..1018f4f6fa42c16a11930283f8ddf2c2f87642d3 100755
(executable)
--- a/
git-cvsimport.perl
+++ b/
git-cvsimport.perl
@@
-575,9
+575,11
@@
($$)
# run cvsps into a file unless we are getting
# it passed as a file via $opt_P
#
# run cvsps into a file unless we are getting
# it passed as a file via $opt_P
#
+my $cvspsfile;
unless ($opt_P) {
print "Running cvsps...\n" if $opt_v;
my $pid = open(CVSPS,"-|");
unless ($opt_P) {
print "Running cvsps...\n" if $opt_v;
my $pid = open(CVSPS,"-|");
+ my $cvspsfh;
die "Cannot fork: $!\n" unless defined $pid;
unless ($pid) {
my @opt;
die "Cannot fork: $!\n" unless defined $pid;
unless ($pid) {
my @opt;
@@
-590,18
+592,18
@@
($$)
exec("cvsps","--norc",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
die "Could not start cvsps: $!\n";
}
exec("cvsps","--norc",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
die "Could not start cvsps: $!\n";
}
-
my
($cvspsfh, $cvspsfile) = tempfile('gitXXXXXX', SUFFIX => '.cvsps',
-
DIR => File::Spec->tmpdir());
+ ($cvspsfh, $cvspsfile) = tempfile('gitXXXXXX', SUFFIX => '.cvsps',
+ DIR => File::Spec->tmpdir());
while (<CVSPS>) {
print $cvspsfh $_;
}
close CVSPS;
close $cvspsfh;
while (<CVSPS>) {
print $cvspsfh $_;
}
close CVSPS;
close $cvspsfh;
- $opt_P = $cvspsfile;
+} else {
+ $cvspsfile = $opt_P;
}
}
-
-open(CVS, "<$opt_P") or die $!;
+open(CVS, "<$cvspsfile") or die $!;
## cvsps output:
#---------------------
## cvsps output:
#---------------------
@@
-936,6
+938,10
@@
sub commit {
}
commit() if $branch and $state != 11;
}
commit() if $branch and $state != 11;
+unless ($opt_P) {
+ unlink($cvspsfile);
+}
+
# The heuristic of repacking every 1024 commits can leave a
# lot of unpacked data. If there is more than 1MB worth of
# not-packed objects, repack once more.
# The heuristic of repacking every 1024 commits can leave a
# lot of unpacked data. If there is more than 1MB worth of
# not-packed objects, repack once more.