From: Ian Jackson Date: Mon, 20 Feb 2012 14:46:25 +0000 (+0000) Subject: add source download feature X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=d442a8503cb012b0abbc86c9a19e5c0e2bfdd116;p=rrd-graphs.git add source download feature --- diff --git a/cgi b/cgi index 9628237..c80e5f9 100755 --- a/cgi +++ b/cgi @@ -379,6 +379,26 @@ if (param('debug')) { print "Content-Type: text/plain\n\n"; } +sub source_tarball ($$) { + my ($spitoutfn) = @_; +} + +if (path_info() =~ m/\.tar\.gz$/) { + print "Content-Type: application/octet-stream\n\n"; + + exec '/bin/sh','-c',' + ( + git-ls-files -z; + git-ls-files -z --others --exclude-from=.gitignore; + if test -d .git; then find .git -print0; fi + ) | ( + cpio -Hustar -o --quiet -0 -R 1000:1000 || \ + cpio -Hustar -o --quiet -0 + ) | gzip + '; + die $!; +} + our @navsettings; @navsettings= (); @@ -564,3 +584,13 @@ foreach my $group (@{ $section_groups{$section} }) { print "\n"; } +my $homeurl = + 'http://www.chiark.greenend.org.uk/ucgi/~ijackson/git/rrd-graphs/'; +print <Generated by "rrd-graphs". +Copyright 2010,2012 Ian Jackson. There is NO WARRANTY. +Available under the Affero Public General Licence, version 3 or any +later version. You may download the +source code +for the version currently running here. +END