summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinfra/dgit-ssh-dispatch10
1 files changed, 7 insertions, 3 deletions
diff --git a/infra/dgit-ssh-dispatch b/infra/dgit-ssh-dispatch
index bc23a4b..cdc610d 100755
--- a/infra/dgit-ssh-dispatch
+++ b/infra/dgit-ssh-dispatch
@@ -137,6 +137,12 @@ sub serve_up ($) {
die "exec git: $!";
}
+sub perllib_local () {
+ $ENV{'PERLLIB'} //= '';
+ $ENV{'PERLLIB'} =~ s#^(?=.)#:#;
+ $ENV{'PERLLIB'} =~ s#^# $ENV{DGIT_TEST_INTREE} // $dgitlive #e;
+}
+
sub dispatch () {
local ($_) = $ENV{'SSH_ORIGINAL_COMMAND'} // '';
@@ -150,9 +156,7 @@ sub dispatch () {
my $cmd=$1;
selectpackage $2,$3;
if ($cmd eq 'receive-pack') {
- $ENV{'PERLLIB'} //= '';
- $ENV{'PERLLIB'} =~ s#^(?=.)#:#;
- $ENV{'PERLLIB'} =~ s#^# $ENV{DGIT_TEST_INTREE} // $dgitlive #e;
+ perllib_local();
my $s = "$dgitlive/infra/dgit-repos-server";
$s = "dgit-repos-server" if !stat_exists $s;
exec $s, $distro, $d, $authrune, qw(--ssh);