X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=blobdiff_plain;f=git-daemon%2Fgit-daemon-urlmap.pl;h=61c376cbe9328f4dfc340acb63e825ffa4350202;hp=5f587be08647bf1a034f94eb9f645dcfb152330d;hb=18c4999f61d703d687b3c96e419ec9f4d81541fe;hpb=08e30b5e72511f4d6b026b40ab3125ae05c81868 diff --git a/git-daemon/git-daemon-urlmap.pl b/git-daemon/git-daemon-urlmap.pl index 5f587be..61c376c 100644 --- a/git-daemon/git-daemon-urlmap.pl +++ b/git-daemon/git-daemon-urlmap.pl @@ -1,20 +1,27 @@ -# Configuration file for the userv git daemon. +# Example configuration file for the userv git daemon. # # This was written by Tony Finch # You may do anything with it, at your own risk. # http://creativecommons.org/publicdomain/zero/1.0/ -use warnings; -use strict; - -my $g = qr{[0-9a-z_-]+[.]git}; -my $u = qr{[0-9a-z]+}; - -return "~fanf/public-git/$1", "fanf" if m{^git://dotat[.]at/($g)$}; -return "/u2/git-repos$1", "webmaster" if m{^git://git[.]chiark[.]greenend[.]org[.]uk/($g)$}; -return "~$1/public-git/$2", "$1" if m{^git://git[.]chiark[.]greenend[.]org[.]uk/~($u)/($g)$}; -return "~$1/cabal-git/$2", "$1" if m{^git://cabal[.]greenend[.]org[.]uk/~($u)/($g)$}; - -return; +if ($host eq 'git.chiark.greenend.org.uk') { + if ($path =~ m{^~([^/]*)/(.*)}) { + $user = $1; + $dir = 'public-git'; + $repo = $2; + } else { + $user = 'webmaster'; + $dir = '/u2/git-repos'; + $repo = $path; + } +} elsif (m{^git://cabal[.]greenend[.]org[.]uk/~([^/]*)/(.*)$}) { + $user = $1; + $dir = 'cabal-git'; + $repo = $2; +} elsif ($host eq 'dotat.at') { + $user = 'fanf'; + $dir = 'public-git'; + $repo = $path; +} # end