chiark / gitweb /
Infra: dgit-ssh-dispatch sets PERLLIB
[dgit.git] / infra / dgit-ssh-dispatch
index e1fc241250a997d04eed57b584454bd615c032c6..f5250555bb44ad3ce8cb1c8e5b00ef50ac4a28e3 100755 (executable)
@@ -130,6 +130,9 @@ 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;
            my $s = "$dgitlive/infra/dgit-repos-server";
            exec $s, $distro, $d, $authrune, qw(--ssh);
            die "exec $s: $!";
@@ -139,6 +142,14 @@ sub dispatch () {
        } else {
            die "unsupported git operation $cmd ($_)";
        }
+    } elsif (
+ m#^${qre}git-upload-pack ${qre}/dgit/($lre)/(?:repos/)?_dgit-repos-server\.git${qre}$#
+       ) {
+       my $distro= $1;
+       serve_up("$dispatchdir/distro=$1/dgit-live/.git");
+    } elsif (m#^${qre}git-upload-pack\s#) {
+       die "unknown repo to serve ($_).  use dgit, or for server source ".
+           "git clone here:/dgit/DISTRO/repos/_dgit-repos-server.git";
     } else {
        die "unsupported operation ($_)";
     }