diff options
-rwxr-xr-x | dgit | 9 | ||||
-rw-r--r-- | dgit.1 | 4 | ||||
-rwxr-xr-x | infra/dgit-ssh-dispatch | 8 | ||||
-rwxr-xr-x | tests/tests/dsd-clone-drs | 17 |
4 files changed, 38 insertions, 0 deletions
@@ -2636,6 +2636,15 @@ sub cmd_archive_api_query { exec @cmd or fail "exec curl: $!\n"; } +sub cmd_clone_dgit_repos_server { + badusage "need destination argument" unless @ARGV==1; + my ($destdir) = @ARGV; + $package = '_dgit-repos-server'; + my @cmd = (@git, qw(clone), access_giturl(), $destdir); + debugcmd ">",@cmd; + exec @cmd or fail "exec git clone: $!\n"; +} + #---------- argument parsing and main program ---------- sub cmd_version { @@ -202,6 +202,10 @@ ask it to generate a single squashed patch instead. .TP .B dgit version Prints version information and exits. +.TP +.BI "dgit clone-dgit-repos-server" " destdir" +Tries to fetch a copy of the source code for the dgit-repos-server, +as actually being used on the dgit git server, as a git tree. .SH OPTIONS .TP .BR --dry-run | -n diff --git a/infra/dgit-ssh-dispatch b/infra/dgit-ssh-dispatch index e1fc241..377f8b8 100755 --- a/infra/dgit-ssh-dispatch +++ b/infra/dgit-ssh-dispatch @@ -139,6 +139,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 ($_)"; } diff --git a/tests/tests/dsd-clone-drs b/tests/tests/dsd-clone-drs new file mode 100755 index 0000000..3474160 --- /dev/null +++ b/tests/tests/dsd-clone-drs @@ -0,0 +1,17 @@ +#!/bin/bash +set -e +. tests/lib +if ! test -d $root/.git; then + echo >&2 'not running out of git clone, cannot test self-clone' + exit 0 +fi + +t-dsd + +cd $tmp +t-dgit clone-dgit-repos-server drs-cloned + +cd drs-cloned +ls -al infra/dgit-repos-server + +echo ok. |