summaryrefslogtreecommitdiff
path: root/infra
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2023-02-04 15:40:18 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2023-02-04 15:41:12 +0000
commitcaabc31be87f90364c74988f64bec9c53e943dcb (patch)
tree8b3fef752a75f8b97f06672f53f4cfba5a4ba2c6 /infra
parent097e75b676bf886e2cf1bf5fbd0459382edd43b2 (diff)
dgit-ssh-dispatch: Break out perllib_local
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'infra')
-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);