chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test suite: examplegit: Make two pushes to unstable
[dgit.git]
/
infra
/
dgit-ssh-dispatch
diff --git
a/infra/dgit-ssh-dispatch
b/infra/dgit-ssh-dispatch
index 377f8b81d6786ba706ea73e75e0ac2aa6c3043d2..17db26887ce744c92704eaa69d1fdafb6e5edaee 100755
(executable)
--- a/
infra/dgit-ssh-dispatch
+++ b/
infra/dgit-ssh-dispatch
@@
-1,9
+1,11
@@
#!/usr/bin/perl -w
use strict;
#!/usr/bin/perl -w
use strict;
-use POSIX;
use Debian::Dgit;
use Debian::Dgit;
+setup_sigwarn();
+
+use POSIX;
open DEBUG, '>/dev/null' or die $!;
if (@ARGV && $ARGV[0] eq '-D') {
open DEBUG, '>/dev/null' or die $!;
if (@ARGV && $ARGV[0] eq '-D') {
@@
-22,7
+24,7
@@
our $lre = $package_re;
our $qre = '["'."']?";
# $dispatchdir/distro=DISTRO should contain
our $qre = '["'."']?";
# $dispatchdir/distro=DISTRO should contain
-# dgit-live
a clone of dgit
+# dgit-live
a clone of dgit (only if not using installed vsns)
# diverts
# repos/ } by virtue of
# suites } dgit-repos-server's defaults relating to
# diverts
# repos/ } by virtue of
# suites } dgit-repos-server's defaults relating to
@@
-32,6
+34,7
@@
our $qre = '["'."']?";
# diverts should be list of
# <pat> [<divert-to>]
# where <pat> is a package name pattern which may contain * or literals.
# diverts should be list of
# <pat> [<divert-to>]
# where <pat> is a package name pattern which may contain * or literals.
+# <divert-to> is for `git config dgit-distro.DISTRO.diverts.<divert-to>'
our ($distro,$pkg, $d);
our ($dgitlive,$repos,$suites,$diverts,$policyhook,$repo);
our ($distro,$pkg, $d);
our ($dgitlive,$repos,$suites,$diverts,$policyhook,$repo);
@@
-118,7
+121,7
@@
sub serve_up ($) {
}
sub dispatch () {
}
sub dispatch () {
- local ($_) = $ENV{'SSH_ORIGINAL_COMMAND'};
+ local ($_) = $ENV{'SSH_ORIGINAL_COMMAND'}
// ''
;
if (m#^: dgit ($lre) git-check ($lre) ;#) {
selectpackage $1,$2, sub { prl "divert @_"; finish; };
if (m#^: dgit ($lre) git-check ($lre) ;#) {
selectpackage $1,$2, sub { prl "divert @_"; finish; };
@@
-130,7
+133,11
@@
sub dispatch () {
my $cmd=$1;
selectpackage $2,$3;
if ($cmd eq 'receive-pack') {
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";
my $s = "$dgitlive/infra/dgit-repos-server";
+ $s = "dgit-repos-server" if !stat_exists $s;
exec $s, $distro, $d, $authrune, qw(--ssh);
die "exec $s: $!";
} elsif ($cmd eq 'upload-pack') {
exec $s, $distro, $d, $authrune, qw(--ssh);
die "exec $s: $!";
} elsif ($cmd eq 'upload-pack') {
@@
-143,6
+150,8
@@
sub dispatch () {
m#^${qre}git-upload-pack ${qre}/dgit/($lre)/(?:repos/)?_dgit-repos-server\.git${qre}$#
) {
my $distro= $1;
m#^${qre}git-upload-pack ${qre}/dgit/($lre)/(?:repos/)?_dgit-repos-server\.git${qre}$#
) {
my $distro= $1;
+ # if running installed packages, source code should come
+ # some other way
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 ".
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 ".