diff options
author | Eric Wong <e@80x24.org> | 2016-04-25 09:50:01 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-04-25 09:50:32 +0000 |
commit | fe3d2447badd595df784541556311137b920b0a2 (patch) | |
tree | 6e37ab61406654680fd6757593cf810370055ecb /lib/PublicInbox/Import.pm | |
parent | 51c59323fffbfbb6ebc60f58da905e88ac323da5 (diff) | |
download | public-inbox-fe3d2447badd595df784541556311137b920b0a2.tar.gz |
By converting to using ourt git-fast-import-based Import module. This should allow us to be more easily installed.
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r-- | lib/PublicInbox/Import.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 8a40fb53..8dd11d03 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -195,6 +195,20 @@ sub done { my $pid = delete $self->{pid} or die 'BUG: missing {pid} when done'; waitpid($pid, 0) == $pid or die 'fast-import did not finish'; $? == 0 or die "fast-import failed: $?"; + + # for compatibility with existing ssoma installations + # we can probably remove this entirely by 2020 + my $git_dir = $self->{git}->{git_dir}; + my $index = "$git_dir/ssoma.index"; + # XXX: change the following scope to: if (-e $index) # in 2018 or so.. + unless ($ENV{FAST}) { + local $ENV{GIT_INDEX_FILE} = $index; + system('git', "--git-dir=$git_dir", qw(read-tree -m -v -i), + $self->{ref}) == 0 or + die "failed to update $git_dir/ssoma.index: $?\n"; + } + + my $lockfh = delete $self->{lockfh} or die "BUG: not locked: $!"; flock($lockfh, LOCK_UN) or die "unlock failed: $!"; close $lockfh or die "close lock failed: $!"; |