X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=infra%2Fdgit-ssh-dispatch;h=c5861d2d8b4223ca764e24f78df6223714ef7b47;hp=6d4efbff655d61d0b746f96d00cb540266677ff0;hb=e13fa49a03cd782945cf142fa94232a183b8e753;hpb=68ace2786dc26749014ea70a6ebb2b896b1f25d1 diff --git a/infra/dgit-ssh-dispatch b/infra/dgit-ssh-dispatch index 6d4efbff..c5861d2d 100755 --- a/infra/dgit-ssh-dispatch +++ b/infra/dgit-ssh-dispatch @@ -1,9 +1,28 @@ #!/usr/bin/perl -w +# wrapper to dispatch git ssh service requests +# +# Copyright (C) 2015-2016 Ian Jackson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . use strict; -use POSIX; +use Debian::Dgit::Infra; # must precede Debian::Dgit; - can change @INC! use Debian::Dgit; +setup_sigwarn(); + +use POSIX; open DEBUG, '>/dev/null' or die $!; if (@ARGV && $ARGV[0] eq '-D') { @@ -32,6 +51,7 @@ our $qre = '["'."']?"; # diverts should be list of # [] # where is a package name pattern which may contain * or literals. +# is for `git config dgit-distro.DISTRO.diverts.' our ($distro,$pkg, $d); our ($dgitlive,$repos,$suites,$diverts,$policyhook,$repo); @@ -118,7 +138,7 @@ sub serve_up ($) { } 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; };